-
Notifications
You must be signed in to change notification settings - Fork 3
ci: adopt shared @btravstack reusable CI + release workflows #335
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
3 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -1,69 +1,17 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["CI"] | ||
| types: | ||
| - completed | ||
| branches: | ||
| - main | ||
|
|
||
| types: [completed] | ||
| branches: [main] | ||
| concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | ||
| with: | ||
| # Use the PAT here too so the git remote is configured with PAT | ||
| # credentials. The bare GITHUB_TOKEN-authenticated push that | ||
| # checkout normally sets up is treated by GitHub as a bot event | ||
| # and would not fire `pull_request` workflows on the resulting | ||
| # branch — defeating the whole point of using a PAT for releases. | ||
| token: ${{ secrets.RELEASE_PAT }} | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| # No standalone build step: the publish path (`pnpm run release`) | ||
| # already runs `pnpm build`, and the version path doesn't need one. | ||
| - name: Create Release Pull Request or Publish to npm | ||
| id: changesets | ||
| uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1 | ||
| with: | ||
| # Use `pnpm run …` so we invoke the package.json scripts. Bare | ||
| # `pnpm version` collides with pnpm's built-in `version` command and | ||
| # silently prints `process.versions` instead of running the changeset | ||
| # version script, leaving package.json files untouched and the | ||
| # release stuck. | ||
| version: pnpm run version | ||
| publish: pnpm run release | ||
| commit: "chore: release packages" | ||
| title: "chore: release packages" | ||
| env: | ||
| # Use a Personal Access Token rather than the default GITHUB_TOKEN. | ||
| # Events triggered by GITHUB_TOKEN do not start new workflow runs | ||
| # (GitHub's anti-recursion safeguard), so the "Version Packages" | ||
| # PR opened by this action would otherwise skip CI entirely. A PAT | ||
| # attributes the PR to a real user and CI fires normally. | ||
| # Required repo secret: RELEASE_PAT (classic PAT with `repo` scope, | ||
| # or a fine-grained token with Contents: read/write + Pull requests: | ||
| # read/write on this repo). | ||
| GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} | ||
| # NPM_TOKEN is intentionally absent — npm Trusted Publishing uses | ||
| # the OIDC token minted via `id-token: write` above. Each package | ||
| # must have a Trusted Publisher configured on npmjs.com pointing | ||
| # at this repo + workflow file (.github/workflows/release.yml). | ||
| uses: btravstack/config/.github/workflows/release-reusable.yml@workflows-v1 | ||
| secrets: | ||
| RELEASE_PAT: ${{ secrets.RELEASE_PAT }} | ||
|
btravers marked this conversation as resolved.
|
||
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.