Skip to content

Commit

Permalink
New github actions workflow to publish to npm using semver
Browse files Browse the repository at this point in the history
  • Loading branch information
kahilof authored Oct 18, 2023
1 parent 9b3e232 commit 42cfe14
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Release
on:
push:
tags:
- v**
branches: [main]

jobs:
publish:
Expand All @@ -16,11 +15,17 @@ jobs:
- run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- run: yarn install --immutable --immutable-cache --check-cache
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
- name: Install semantic-release extra plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
- run: yarn tsc
- run: yarn build
# VERSION has v prefix but yarn wants valid semver.
- run: yarn publish --new-version ${VERSION:1} --access public --no-git-tag-version
- name: Create .npmrc file
run: |
echo registry=https://registry.npmjs.org/ > .npmrc
echo '//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}' >> .npmrc
- name: Release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ github.ref_name }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

0 comments on commit 42cfe14

Please sign in to comment.