Skip to content

Commit

Permalink
NPM publish from GHA
Browse files Browse the repository at this point in the history
Align build.yml with similar projects
  • Loading branch information
microbit-matt-hillsdon committed Apr 17, 2024
1 parent 4192638 commit 7667a25
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 85 deletions.
76 changes: 0 additions & 76 deletions .circleci/config.yml

This file was deleted.

28 changes: 19 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: Test & Build

name: build
on:
release:
types: [created]
push:
branches: '*'
pull_request:
branches: '*'

branches:
- '**'
jobs:
test-build:
name: Run tests and build project
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run test:coverage
- run: npm run build
- run: npm publish
if: github.event_name == 'release' && github.event.action == 'created'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 7667a25

Please sign in to comment.