Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
npm-publish-latest
  • Loading branch information
bourgeoa authored Feb 13, 2023
1 parent 7988f6a commit f4bf782
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- run: npm test
- run: npm run build --if-present
- name: Save build
if: matrix.node-version == '14.x'
if: matrix.node-version == '16.x'
uses: actions/upload-artifact@v2
with:
name: build
Expand All @@ -52,7 +52,7 @@ jobs:
name: build
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x
- uses: rlespinasse/[email protected]
- name: Append commit hash to package version
run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
Expand All @@ -62,3 +62,21 @@ jobs:
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ env.GITHUB_REF_SLUG }}

npm-publish-latest:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v2
with:
name: build
- uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Disable pre- and post-publish actions
run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: latest

0 comments on commit f4bf782

Please sign in to comment.