Skip to content

Commit

Permalink
Merge pull request #283 from ditrit/feature/update_publish
Browse files Browse the repository at this point in the history
Feature: update publish workflow
  • Loading branch information
Zorin95670 authored Aug 19, 2024
2 parents 154dbe5 + 38777f1 commit e8fde4f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 51 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
name: Setup app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -57,9 +57,9 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -77,9 +77,9 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -102,9 +102,9 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -130,9 +130,9 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -156,7 +156,7 @@ jobs:
needs: [check-style, unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/docs.yml

This file was deleted.

53 changes: 50 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+'

jobs:
publish:
publish_npm:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand All @@ -29,3 +29,50 @@ jobs:
run: npm login && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}


publish_docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'

- name: Setup npm
run: npm install -g [email protected]

- uses: actions/cache/restore@v3
with:
path: node_modules
key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('./package-lock.json') }}

- name: Install dependencies
run: npm install

- name: Prepare generation of documentation
run: npm run prepare:docs

- name: Prepare generation of documentation
run: npm run build:docs

- name: Extract version from package.json
id: extract_version
run: VERSION=$(jq -r '.version' package.json) echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/@ditrit/leto-modelizer-plugin-core/${{env.PACKAGE_VERSION}}'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .github/workflows/stat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
name: Save sonar statistics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: 'https://registry.npmjs.org'
Expand Down

0 comments on commit e8fde4f

Please sign in to comment.