@@ -25,41 +25,35 @@ jobs:
2525 uses : actions/checkout@v4
2626 with :
2727 ref : ${{ github.ref }}
28- # check out to the repository root (workspace) so forks don't depend on upstream paths
29- path : .
30- fetch-depth : 0
31- fetch-tags : true
28+ path : src/github.com/containerd/containerd
3229
3330 - name : Check signature
3431 run : |
3532 releasever=${{ github.ref }}
3633 releasever="${releasever#refs/tags/}"
37- # Only enforce strict signature verification when running in the canonical upstream repository.
38- # For forks, skip strict GPG verification because CI may not have the public keys.
39- if [ "${{ github.repository }}" = "containerd/containerd" ]; then
40- if ! git tag -v "${releasever}"; then
34+ TAGCHECK=$(git tag -v ${releasever} 2>&1 >/dev/null) ||
35+ echo "${TAGCHECK}" | grep -q "error" && {
4136 echo "::error::tag ${releasever} is not a signed tag. Failing release process."
4237 exit 1
43- fi
44- echo "Tag ${releasever} is signed."
45- else
46- echo "Running in fork (${GITHUB_REPOSITORY}); skipping strict tag signature verification."
47- fi
48- working-directory : .
38+ } || {
39+ echo "Tag ${releasever} is signed."
40+ exit 0
41+ }
42+ working-directory : src/github.com/containerd/containerd
4943
5044 - name : Release content
5145 id : contentrel
5246 run : |
5347 RELEASEVER=${{ github.ref }}
5448 echo "stringver=${RELEASEVER#refs/tags/api/v}" >> $GITHUB_OUTPUT
5549 git tag -l ${RELEASEVER#refs/tags/} -n20000 | tail -n +3 | cut -c 5- >release-notes.md
56- working-directory : .
50+ working-directory : src/github.com/containerd/containerd
5751
5852 - name : Save release notes
5953 uses : actions/upload-artifact@v4
6054 with :
6155 name : containerd-release-notes
62- path : release-notes.md
56+ path : src/github.com/containerd/containerd/ release-notes.md
6357
6458 release :
6559 name : Create containerd Release
7468 uses : actions/download-artifact@v4
7569 with :
7670 path : builds
77- - name : Prepare release token check
78- id : tokencheck
79- run : |
80- # Determine whether a RELEASE_TOKEN secret is provided; expose result as an output
81- if [ -n "${{ secrets.RELEASE_TOKEN }}" ]; then
82- echo "use_release_token=true" >> $GITHUB_OUTPUT
83- else
84- echo "use_release_token=false" >> $GITHUB_OUTPUT
85- fi
86- - name : Create Release (with RELEASE_TOKEN)
87- if : ${{ steps.tokencheck.outputs.use_release_token == 'true' }}
88- uses : softprops/action-gh-release@v2
89- with :
90- token : ${{ secrets.RELEASE_TOKEN }}
91- fail_on_unmatched_files : true
92- name : containerd API ${{ needs.check.outputs.stringver }}
93- draft : false
94- make_latest : false
95- prerelease : ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
96- body_path : ./builds/containerd-release-notes/release-notes.md
97-
98- - name : Create Release (with GITHUB_TOKEN)
99- if : ${{ steps.tokencheck.outputs.use_release_token == 'false' }}
71+ - name : Create Release
10072 uses : softprops/action-gh-release@v2
10173 with :
10274 token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments