Workflow file for this run
This file contains hidden or 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 Bun environment | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
registry-url: "https://registry.npmjs.org" | |
scope: "@flowcore" | |
- name: Bun install | |
run: | | |
bun install --frozen-lockfile | |
- name: Build | |
run: bun run build | |
- name: Publish | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
echo "Publishing version ${{ steps.version.outputs.value }}" | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |