Skip to content

Commit

Permalink
Add GitHub action for build workflow
Browse files Browse the repository at this point in the history
This will publish the ml-header-generator package.
  • Loading branch information
microbit-robert committed Jun 3, 2024
1 parent c889638 commit dbbcd54
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build
on:
release:
types: [created]
push:
branches:
- "**"
paths:
- "header-gen/**"
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./header-gen
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
cache: npm
- uses: microbit-foundation/npm-package-versioner-action@v1
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run ci:update-version
- run: npm run build
- run: npm publish
if: github.ref == 'refs/heads/main' || github.event_name == 'release' && github.event.action == 'created'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dbbcd54

Please sign in to comment.