Update package metadata #40
Workflow file for this run
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: publish | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.version.outputs.tag }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Get package version | |
run: echo "tag=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT" | |
id: version | |
- name: Debug target version | |
run: echo $NPM_RELEASE | |
env: | |
NPM_RELEASE: ${{ steps.version.outputs.tag }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: version | |
if: github.event.pull_request.merged == true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Build project | |
run: make build | |
- name: Tag release | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ needs.version.outputs.tag }} | |
- name: Configure NPM access credentials | |
run: | | |
npm config set \ | |
//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | |
- name: Configure GPR access credentials | |
run: | | |
npm config set \ | |
//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} | |
- name: Publish package to GPR | |
run: | | |
npm publish --verbose --access public --registry https://npm.pkg.github.com | |
- name: Publish package to NPM | |
run: | | |
npm publish --verbose --access public --registry https://registry.npmjs.org/ |