Skip to content
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

Make the release process create annotated tags #3686

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
env:
VERSION: ${{ steps.next.outputs.version }}
with:
result-encoding: string
# Commit & tag with the actions token, so that they get signed
# This returns the commit sha and the tag object sha
script: |
const fs = require("fs/promises");
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
Expand Down Expand Up @@ -122,27 +122,29 @@ jobs:
});
console.log("Created tag:", tag.data.url);

return commit.data.sha;
return { commit: commit.data.sha, tag: tag.data.sha };

- name: Update the refs
uses: actions/github-script@v7.0.1
env:
VERSION: ${{ steps.next.outputs.version }}
COMMIT: ${{ steps.commit.outputs.result }}
TAG_SHA: ${{ fromJSON(steps.commit.outputs.result).tag }}
COMMIT_SHA: ${{ fromJSON(steps.commit.outputs.result).commit }}
with:
# Update the refs with the bot token, so that workflows are triggered
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
const version = process.env.VERSION;
const commit = process.env.COMMIT;
const commit = process.env.COMMIT_SHA;
const tag = process.env.TAG_SHA;
const branch = process.env.GITHUB_REF_NAME;

const tag = await github.rest.git.createRef({
owner,
repo,
ref: `refs/tags/v${version}`,
sha: commit,
sha: tag,
});
console.log("Created tag ref:", tag.data.url);

Expand Down
Loading