|
15 | 15 |
|
16 | 16 | - name: Sanity checks
|
17 | 17 | run: |
|
| 18 | + # GHA makes the tag point to the commit rather than the tag object. |
| 19 | + # Remove the tag and fetch it again to get the real tag object. |
| 20 | + git tag -d "$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" |
| 21 | + git fetch https://github.com/trifectatechfoundation/sudo-rs.git --tags |
| 22 | +
|
18 | 23 | # Check if the tag has a signature to prevent accidentally pushing an unsigned tag.
|
19 | 24 | git tag -l --format='%(contents:signature)' "$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" | grep --quiet SIGNATURE || (echo "Tag not signed"; exit 1)
|
20 | 25 |
|
|
32 | 37 |
|
33 | 38 | - name: Compare checksums
|
34 | 39 | run: |
|
35 |
| - # GHA makes the tag point to the commit rather than the tag object. |
36 |
| - # Remove the tag and fetch it again to get the real tag object. |
37 |
| - git tag -d "$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" |
38 |
| - git fetch https://github.com/bjorn3/sudo-rs.git --tags |
39 |
| -
|
40 | 40 | # Get the expected checksums from the tag message.
|
41 | 41 | git tag -l --format='%(contents:body)' "$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" | tr -s '\n' > expected_checksums.txt
|
42 | 42 |
|
@@ -69,14 +69,20 @@ jobs:
|
69 | 69 |
|
70 | 70 | # Extract the first changelog entry from CHANGELOG.md
|
71 | 71 | echo "Changelog:"
|
72 |
| - sed -n '4,${ /^## /q; p; }' CHANGELOG.md |
| 72 | + sed -n '4,${ /^## /q; p; }' CHANGELOG.md | tee changes.md |
73 | 73 |
|
74 | 74 | - name: Create release
|
75 | 75 | env:
|
76 | 76 | GH_TOKEN: ${{ github.token }}
|
77 | 77 | run: |
|
78 |
| - gh release create "$GITHUB_REF" --draft \ |
79 |
| - --title "Version $(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" \ |
| 78 | + # GHA makes the tag point to the commit rather than the tag object. |
| 79 | + # Remove the tag and fetch it again to get the real tag object. |
| 80 | + RELEASE="$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')" |
| 81 | + git tag -d "$RELEASE" |
| 82 | + git fetch https://github.com/trifectatechfoundation/sudo-rs.git --tags |
| 83 | +
|
| 84 | + gh release create "$RELEASE" --draft \ |
| 85 | + --title "Version ${RELEASE#v}" \ |
80 | 86 | --notes-file changes.md release_files/* \
|
81 | 87 | --verify-tag
|
82 | 88 | echo "Draft release successfully created. Please review and publish."
|
0 commit comments