Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/action-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# copied from https://github.com/Fieldguide/github-actions-common/blob/main/.github/workflows/action-lint.yaml

name: Action Lint
on:
pull_request:
paths:
- .github/**/*.ya?ml
workflow_call:
jobs:
ci:
uses: fieldguide/github-actions-common/.github/workflows/action-lint.yaml@main
actionlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1.65.2
with:
actionlint_flags: "-shellcheck= "
fail_level: error
55 changes: 48 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Publish to npm"
name: "Publish package"

on:
release:
Expand All @@ -14,22 +14,29 @@ env:
SLACK_DEPLOY_ERROR_REACTION: ${{ vars.SLACK_DEPLOY_ERROR_REACTION_PRODUCTION }}

jobs:
publish:
start:
runs-on: ubuntu-latest
outputs:
thread_ts: ${{ steps.slack.outputs.ts }}
version: ${{ steps.version.outputs.value }}
steps:
- name: Post to Slack
uses: Fieldguide/action-slack-deploy-pipeline@v2
id: slack

- name: Checkout code
uses: actions/checkout@v4

- name: Parse version
id: version
run: echo "value=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT

publish-npm:
needs: start
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Update npm package version for build / publishing
run: npm version ${{ steps.version.outputs.value }} --no-git-tag-version
run: npm version ${{ needs.start.outputs.version }} --no-git-tag-version

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -47,9 +54,43 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-github:
needs: start
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Update npm package version for build / publishing
run: npm version ${{ needs.start.outputs.version }} --no-git-tag-version

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
registry-url: "https://npm.pkg.github.com"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need to specify scope here, too?

Copy link
Contributor Author

@nrutman nrutman Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was taking my inspiration from the publish jobs in the js-common repo...for example:

https://github.com/Fieldguide/js-common/blob/main/.github/workflows/publish-files.yaml

...and those don't use a scope when publishing to GitHub.


- name: Install dependencies
run: npm ci --prefer-offline --no-audit

- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

finish:
needs:
- start
- publish-npm
- publish-github
runs-on: ubuntu-latest
steps:
- name: "Post to Slack"
uses: Fieldguide/action-slack-deploy-pipeline@v2
if: always()
with:
thread_ts: ${{ steps.slack.outputs.ts }}
thread_ts: ${{ needs.start.outputs.thread_ts }}
conclusion: true