Skip to content

Commit 7d6e455

Browse files
committed
Make the release process create annotated tags
1 parent b690542 commit 7d6e455

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/release.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
env:
6262
VERSION: ${{ steps.next.outputs.version }}
6363
with:
64-
result-encoding: string
6564
# Commit & tag with the actions token, so that they get signed
65+
# This returns the commit sha and the tag object sha
6666
script: |
6767
const fs = require("fs/promises");
6868
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
@@ -122,27 +122,29 @@ jobs:
122122
});
123123
console.log("Created tag:", tag.data.url);
124124
125-
return commit.data.sha;
125+
return { commit: commit.data.sha, tag: tag.data.sha };
126126
127127
- name: Update the refs
128128
uses: actions/[email protected]
129129
env:
130130
VERSION: ${{ steps.next.outputs.version }}
131-
COMMIT: ${{ steps.commit.outputs.result }}
131+
TAG_SHA: ${{ fromJSON(steps.commit.outputs.result).tag }}
132+
COMMIT_SHA: ${{ fromJSON(steps.commit.outputs.result).commit }}
132133
with:
133134
# Update the refs with the bot token, so that workflows are triggered
134135
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
135136
script: |
136137
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
137138
const version = process.env.VERSION;
138-
const commit = process.env.COMMIT;
139+
const commit = process.env.COMMIT_SHA;
140+
const tag = process.env.TAG_SHA;
139141
const branch = process.env.GITHUB_REF_NAME;
140142
141143
const tag = await github.rest.git.createRef({
142144
owner,
143145
repo,
144146
ref: `refs/tags/v${version}`,
145-
sha: commit,
147+
sha: tag,
146148
});
147149
console.log("Created tag ref:", tag.data.url);
148150

0 commit comments

Comments
 (0)