diff --git a/.github/workflows/action-lint.yaml b/.github/workflows/action-lint.yaml index 49e6b8b..74b2a64 100644 --- a/.github/workflows/action-lint.yaml +++ b/.github/workflows/action-lint.yaml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af28b0a..8212c25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: "Publish to npm" +name: "Publish package" on: release: @@ -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 @@ -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" + + - 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