-
Notifications
You must be signed in to change notification settings - Fork 3
feat(ci): add tag-triggered tarball release for ghost-drift #45
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
4 commits
Select commit
Hold shift + click to select a range
0585d10
feat(ci): add tag-triggered tarball release for ghost-drift
nahiyankhan 6c7aa95
fix(ci): drop pnpm cache from release-tarball workflow
nahiyankhan 701c4a7
fix(ci): address zizmor + semgrep alerts on release-tarball workflow
nahiyankhan 9c3071d
fix(ci): drop actions/setup-node to satisfy zizmor cache-poisoning
nahiyankhan 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 |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Publish tarball to GitHub Release | ||
|
|
||
| # Temporary distribution channel while npm publish is blocked. Packs | ||
| # ghost-drift and attaches the .tgz to a GitHub Release, so consumers can: | ||
| # | ||
| # npm install https://github.com/block/ghost/releases/download/<tag>/<file>.tgz | ||
| # | ||
| # Triggered by pushing a tag of the form `ghost-drift@<version>` or by | ||
| # manual workflow_dispatch. | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "ghost-drift@*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version to release (must match packages/ghost-drift/package.json)" | ||
| required: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: tarball-release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| tarball: | ||
| name: Pack and release | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| # No setup-node and no pnpm/action-setup — both would trip zizmor's | ||
| # cache-poisoning rule because any GitHub-official setup action is | ||
| # treated as cache-capable regardless of whether caching is enabled. | ||
| # ubuntu-latest ships Node 20 + corepack, which satisfies our | ||
| # engines.node (>=18). Corepack reads `packageManager` from root | ||
| # package.json to install the exact pinned pnpm version with no | ||
| # cross-branch cache store. | ||
| - run: node --version && corepack enable | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: pnpm --filter ghost-drift build | ||
|
|
||
| - name: Pack | ||
| run: pnpm --filter ghost-drift pack | ||
|
|
||
| # Resolve the release tag. Inputs from workflow_dispatch are attacker- | ||
| # controlled (anyone with Actions write can trigger). Pass them in via | ||
| # `env:` and reference as shell variables so they can't be interpolated | ||
| # as shell syntax — that's what the semgrep shell-injection rule wants. | ||
| - name: Resolve tag | ||
| id: tag | ||
| env: | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| run: | | ||
| if [ "$EVENT_NAME" = "push" ]; then | ||
| TAG="$GITHUB_REF_NAME" | ||
| else | ||
| TAG="ghost-drift@$INPUT_VERSION" | ||
| fi | ||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Create GitHub Release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ steps.tag.outputs.tag }} | ||
| run: | | ||
| gh release create "$TAG" \ | ||
| --title "$TAG" \ | ||
| --generate-notes \ | ||
| packages/ghost-drift/ghost-drift-*.tgz | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
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.
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.