v0.4.2 #63
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: Header Generator | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- "*" | |
paths: | |
- "header-gen/**" | |
- "**/header-gen.yml" | |
pull_request: | |
branches: | |
- "*" | |
paths: | |
- "header-gen/**" | |
- "**/header-gen.yml" | |
jobs: | |
build-and-test: | |
name: Build, test & publish TS lib | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
cache-dependency-path: header-gen/package-lock.json | |
- name: Install Dependencies | |
run: npm ci | |
working-directory: ./header-gen | |
- name: Update version | |
if: github.event_name != 'pull_request' | |
uses: microbit-foundation/npm-package-versioner-action@v1 | |
with: | |
working-directory: ./header-gen | |
- name: Build | |
run: npm run build | |
working-directory: ./header-gen | |
- name: Run Jest Tests | |
run: npm test | |
working-directory: ./header-gen | |
- name: Publish | |
run: npm publish | |
if: github.event_name == 'release' && github.event.action == 'created' | |
working-directory: ./header-gen | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |