-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action for build workflow
This will publish the ml-header-generator package.
- Loading branch information
1 parent
c889638
commit dbbcd54
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |