-
Notifications
You must be signed in to change notification settings - Fork 84
more prep for oidc #608
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
Merged
Merged
more prep for oidc #608
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,19 +2,26 @@ name: Deploy | |
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| branches: | ||
| - main | ||
| - changeset-release/main | ||
| workflow_dispatch: | ||
| # Snapit trigger - runs when /snapit comment is made on a PR | ||
| issue_comment: | ||
| types: | ||
| - created | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| jobs: | ||
| checks: | ||
| name: Checks 📝 | ||
| if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
| uses: ./.github/workflows/checks.yml | ||
|
|
||
| deploy: | ||
| name: Deploy 🚀 | ||
| if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
| needs: [checks] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
|
|
@@ -24,8 +31,77 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: ./.github/workflows/actions/prepare | ||
| - name: Update npm to 11.7 | ||
| run: npm install -g [email protected] | ||
| - run: pnpm run type-check | ||
| - run: pnpm run build | ||
| - run: pnpm run deploy | ||
| env: | ||
| NPM_TOKEN: '' # Empty string forces OIDC | ||
| NPM_CONFIG_PROVENANCE: true | ||
|
|
||
| preview: | ||
| name: Preview 🔮 | ||
| if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == 'changeset-release/main') }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| contents: read | ||
| id-token: write # Required for OIDC authentication | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: ./.github/workflows/actions/prepare | ||
| - name: Update npm to 11.7 | ||
| run: npm install -g [email protected] | ||
|
|
||
| # Changeset entries are consumed on this branch. We need to reset the | ||
| # changeset files so that the snapshot command knows the correct packages, | ||
| # and does not accidentally publish the new, non-preview version numbers | ||
| # prematurely. | ||
| - name: Reset changeset entries | ||
| run: | | ||
| git fetch origin main | ||
| git checkout origin/main -- .changeset | ||
|
|
||
| - run: pnpm run type-check | ||
| - run: pnpm run build | ||
|
|
||
| - name: Deploy preview versions to NPM | ||
| run: | | ||
| pnpm changeset version --snapshot preview | ||
| pnpm changeset publish --tag preview --no-git-tag | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | ||
| NPM_TOKEN: '' # Empty string forces OIDC | ||
| NPM_CONFIG_PROVENANCE: true | ||
|
|
||
| # Snapit job - runs when /snapit comment is made on a PR | ||
| snapit: | ||
| name: Snapit | ||
| if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == '/snapit' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| id-token: write # Required for OIDC authentication | ||
| steps: | ||
| # WARNING: DO NOT RUN ANY CUSTOM LOCAL SCRIPT BEFORE RUNNING THE SNAPIT ACTION | ||
| # This action can be executed by 3rd party users and it should not be able to run arbitrary code from a PR. | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | ||
|
|
||
| - uses: ./.github/workflows/actions/prepare | ||
|
|
||
| - name: Update npm to 11.7 | ||
| run: npm install -g [email protected] | ||
|
|
||
| - name: Create snapshot | ||
| uses: Shopify/[email protected] | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | ||
| NPM_TOKEN: '' # Empty string forces OIDC | ||
| NPM_CONFIG_PROVENANCE: true | ||
| with: | ||
| build_script: pnpm build:snapit | ||
| comment_command: /snapit | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v20.11.0 | ||
| v20.20.0 | ||
|
Member
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. seems needed for npm in the version that we want |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
needed because this is where preview-versions ran before