-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GitHub actions (versions / ergonomics). #172
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Run tests on pushes to all branches. | ||
name: Check Branch | ||
on: [push] | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Publish package to npm whenever a release is pushed. | ||
# See https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
name: Publish to npm | ||
on: [workflow_call] | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general — I’ve updated things to use clean install so that we install from |
||
- run: npm publish | ||
env: | ||
# The secrets should be implicitly passed via “secrets: inherit”. | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Run tests and publish to all registries if successful. | ||
name: Publish | ||
on: | ||
release: | ||
types: [published] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the release type trigger to |
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml | ||
publish-to-npm: | ||
needs: test | ||
uses: ./.github/workflows/publish-to-npm.yaml | ||
secrets: inherit |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
name: Push | ||
on: [push] | ||
# Test flow triggered by other workflows. | ||
name: Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I’ve added a general change to pull out our workflows into reusable chunks. The GitHub UI sort of rewards you with a better UX for doing this (e.g., better graphical representation of what’s happening). |
||
on: [workflow_call] | ||
jobs: | ||
test: | ||
main: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumped all these as part of the node 16 >> 20 upgrades in GH actions. |
||
node-version: '18.x' | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install | ||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm start & | ||
- run: sleep 2 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node version is bumped to
20.x
in all these configuration files.