ahres-1266 #650
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
on: | |
pull_request: | |
branches: [master] | |
name: prerelease | |
jobs: | |
prerelease: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- run: yarn install --immutable | |
- run: yarn dist | |
- run: npm version prerelease --preid=$GITHUB_HEAD_REF-`git rev-parse --short HEAD` --git-tag-version=false --commit-hooks=false | |
- run: | | |
npm config set registry https://npm.pkg.github.com | |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} | |
npm publish --tag $GITHUB_HEAD_REF | |
- name: Extract NPM package name | |
run: echo "::set-output name=npm-name::`node -p -e "require('./package.json').name"`" | |
id: npm-name | |
- name: Extract npm package version | |
run: echo "::set-output name=npm-version::`node -p -e "require('./package.json').version"`" | |
id: npm-version | |
- name: Comment PR | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
recreate: true | |
message: | | |
Released prerelease version `${{ steps.npm-version.outputs.npm-version }}`. | |
You may now run `npm install ${{ steps.npm-name.outputs.npm-name }}@${{ github.head_ref }}` |