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: Build and Publish NPM Package | |
on: | |
release: | |
types: [ published ] | |
env: | |
NODE_VERSION: ">=18.12.1" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.FLOWCORE_MACHINE_GITHUB_TOKEN }} | |
submodules: true | |
- name: Extract version from package.json | |
uses: sergeysova/jq-action@v2 | |
id: version | |
with: | |
cmd: 'jq .version package.json -r' | |
- name: Show my version | |
run: 'echo "version ${{ steps.version.outputs.value }}"' | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: "${{ env.NODE_VERSION }}" | |
registry-url: "https://registry.npmjs.org" | |
cache: yarn | |
- name: Yarn install | |
run: | | |
yarn install --frozen-lockfile | |
- name: Lint | |
run: yarn lint | |
- name: Build | |
run: yarn build | |
- name: Publish | |
run: yarn publish --access public --non-interactive --new-version ${{ steps.version.outputs.value }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |