Repository navigation
ci(release): Move to Craft auto versioning #567
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a98223b
ci(release): Move to Craft auto versioning
sentry-junior[bot] 85ffac6
ci(release): Use floating getsentry/craft@v3 tag
sentry-junior[bot] ff783f7
ci(release): Keep major Action tag off prereleases
sentry-junior[bot] fc78275
ci(release): Commit the action bundle and drop detached release tags
sentry-junior[bot] 9b908fb
build(action): Commit the ncc action bundle (part 1)
sentry-junior[bot] d1e7234
build(action): Commit the ncc action bundle (part 2)
sentry-junior[bot] fd376e3
build(action): Commit the ncc action bundle (part 3)
sentry-junior[bot] d5cfa4f
fix(release): Keep the major tag off the release commit
sentry-junior[bot] e9a1954
ci(action): Rebuild the action bundle on PRs and commit it back
sentry-junior[bot] c13e5ed
ci(action): Skip bundle auto-commit on Dependabot PRs
sentry-junior[bot] 04f3f12
ci(action): Keep the release bot token out of the PR build job
sentry-junior[bot] 62844ca
ci(release): Move v0 with Craft floatingTags
sentry-junior[bot] 8ffb65d
ci(release): Fail auto bumps from a wrong base tag
sentry-junior[bot] 1143078
ci(action): Commit the bundle from a workflow_run job
sentry-junior[bot] 0afc598
ci(codeql): Move to advanced setup and skip dist/
sentry-junior[bot] 07b22cf
fix(ci): Key bundle push concurrency on head SHA
sentry-junior[bot] 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
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| dist/action/** linguist-generated=true |
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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| name: Warden CodeQL config | ||
|
|
||
| # dist/ holds build output, such as the committed ncc bundle in dist/action/. | ||
| # CodeQL scans the source that it is built from. | ||
| paths-ignore: | ||
| - dist/** |
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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Action Bundle | ||
|
|
||
| # Rebuilds dist/action on same-repo PRs. When the committed bundle is stale, | ||
| # the build job uploads the new bundle as an artifact. This workflow runs PR | ||
| # code, so it gets no secrets and a read-only token. commit-action-dist.yml | ||
| # runs on workflow_run from the default branch and commits the artifact back. | ||
| # Fork PRs can't be pushed to, so the "Check action bundle is committed" step | ||
| # in ci.yml stays as the gate there and on every other commit. | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: action-dist-${{ github.head_ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| # Dependabot runs get no Actions secrets, so ci.yml is the gate there. | ||
| if: >- | ||
| github.event.pull_request.head.repo.full_name == github.repository && | ||
| github.actor != 'dependabot[bot]' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - uses: pnpm/action-setup@02f6c237bd2518259fed6c71566509edfb3f2b74 # v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: '24' | ||
| cache: 'pnpm' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm build | ||
| - run: pnpm build:action | ||
|
|
||
| # A stale bundle is not a failure here; commit-action-dist.yml fixes it. | ||
| - name: Check for bundle changes | ||
| id: check | ||
| continue-on-error: true | ||
| run: sh bin/check-action-dist.sh | ||
|
|
||
| - if: steps.check.outcome == 'failure' | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: action-dist | ||
| path: dist/action/ | ||
| retention-days: 1 |
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
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: CodeQL | ||
|
|
||
| # Advanced setup, so .github/codeql/codeql-config.yml can skip dist/. | ||
| # Default setup must be off in the repo settings, or GitHub rejects the | ||
| # uploads from this workflow. | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '27 4 * * 1' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [actions, javascript-typescript, python] | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: none | ||
| config-file: ./.github/codeql/codeql-config.yml | ||
|
|
||
| - uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 | ||
| with: | ||
| category: /language:${{ matrix.language }} |
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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Commit Action Bundle | ||
|
|
||
| # Commits the bundle that action-dist.yml built back to the PR branch. | ||
| # workflow_run always runs this file from the default branch, so a PR cannot | ||
| # change it to read the release bot key. The PR identity comes from the | ||
| # workflow_run payload. The artifact is untrusted data: only regular files | ||
| # are copied, and no code from the PR checkout runs. | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: [Action Bundle] | ||
| types: [completed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| # Key on the head SHA, not the branch. A late run for an older commit must | ||
| # not cancel the push for a newer one. The fast-forward push rejects stale runs. | ||
| concurrency: | ||
| group: commit-action-dist-${{ github.event.workflow_run.head_sha }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| commit: | ||
| if: >- | ||
| github.event.workflow_run.event == 'pull_request' && | ||
| github.event.workflow_run.head_repository.full_name == github.repository && | ||
| github.event.workflow_run.actor.login != 'dependabot[bot]' && | ||
| github.event.workflow_run.head_branch != 'main' && | ||
| !startsWith(github.event.workflow_run.head_branch, 'release/') | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| ARTIFACT_DIR: artifact | ||
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
| steps: | ||
| # Scripts come from the default branch, not from the PR. | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| path: trusted | ||
| persist-credentials: false | ||
|
|
||
| # No artifact means the bundle was fresh. Then nothing is downloaded. | ||
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | ||
| with: | ||
| pattern: action-dist | ||
| merge-multiple: true | ||
| path: ${{ env.ARTIFACT_DIR }} | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ github.token }} | ||
|
Check warning on line 51 in .github/workflows/commit-action-dist.yml
|
||
|
sentry-warden[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| # The exact commit that was built. If the branch moved since, the push | ||
| # is not a fast-forward and fails; the new commit gets its own run. | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| ref: ${{ env.HEAD_SHA }} | ||
| path: pr | ||
| persist-credentials: false | ||
|
|
||
| - name: Commit bundle | ||
| id: commit | ||
| run: sh trusted/bin/commit-action-dist.sh "$ARTIFACT_DIR" pr | ||
|
|
||
| - name: Get auth token | ||
| if: steps.commit.outputs.committed == 'true' | ||
| id: token | ||
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 | ||
| with: | ||
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: Push bundle | ||
| if: steps.commit.outputs.committed == 'true' | ||
| env: | ||
| PUSH_TOKEN: ${{ steps.token.outputs.token }} | ||
| run: sh trusted/bin/push-action-dist.sh pr | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.