-
Notifications
You must be signed in to change notification settings - Fork 0
[SC-58776] Publish Pipeline package to NPM and Github #76
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
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 |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
|
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. I wonder if we need to specify
Contributor
Author
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. I was taking my inspiration from the publish jobs in the https://github.com/Fieldguide/js-common/blob/main/.github/workflows/publish-files.yaml ...and those don't use a |
||
|
|
||
| - 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 | ||
Uh oh!
There was an error while loading. Please reload this page.