Trigger new release (#120) #88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/prepare | |
- name: Build plugin | |
run: pnpm nx build nx-playwright | |
- name: Release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
set -x | |
cd dist/packages/nx-playwright | |
{ | |
echo "scope=@mands" | |
echo "@mands:registry=https://registry.npmjs.org/" | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" | |
} > .npmrc | |
pnpm publish --access=public | |
VERSION=$(node --print "require('./package.json').version") | |
echo "Tagging version $VERSION" | |
git config user.name release-bot | |
git config user.email [email protected] | |
git tag -a "${VERSION}" -m "Version ${VERSION}" | |
git push origin "${VERSION}" |