Skip to content

Commit fc32cec

Browse files
committed
Revert "Refactor GitHub Actions workflows to improve tag handling and signature verification for forks"
This reverts commit 0280c9b.
1 parent b86a7cd commit fc32cec

File tree

2 files changed

+24
-55
lines changed

2 files changed

+24
-55
lines changed

.github/workflows/api-release.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -74,29 +68,7 @@ jobs:
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 }}

.github/workflows/release.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,35 @@ jobs:
3232
uses: actions/checkout@v4
3333
with:
3434
ref: ${{ github.ref }}
35-
path: .
35+
path: src/github.com/containerd/containerd
3636

3737
- name: Check signature
3838
run: |
3939
releasever=${{ github.ref }}
4040
releasever="${releasever#refs/tags/}"
41-
# Only enforce strict signature verification when running in the canonical upstream repository.
42-
# For forks, skip strict GPG verification because CI may not have the public keys.
43-
if [ "${{ github.repository }}" = "containerd/containerd" ]; then
44-
if ! git tag -v "${releasever}"; then
41+
TAGCHECK=$(git tag -v ${releasever} 2>&1 >/dev/null) ||
42+
echo "${TAGCHECK}" | grep -q "error" && {
4543
echo "::error::tag ${releasever} is not a signed tag. Failing release process."
4644
exit 1
47-
fi
48-
echo "Tag ${releasever} is signed."
49-
else
50-
echo "Running in fork (${GITHUB_REPOSITORY}); skipping strict tag signature verification."
51-
fi
52-
working-directory: .
45+
} || {
46+
echo "Tag ${releasever} is signed."
47+
exit 0
48+
}
49+
working-directory: src/github.com/containerd/containerd
5350

5451
- name: Release content
5552
id: contentrel
5653
run: |
5754
RELEASEVER=${{ github.ref }}
5855
echo "stringver=${RELEASEVER#refs/tags/v}" >> $GITHUB_OUTPUT
5956
git tag -l ${RELEASEVER#refs/tags/} -n20000 | tail -n +3 | cut -c 5- >release-notes.md
60-
working-directory: .
57+
working-directory: src/github.com/containerd/containerd
6158

6259
- name: Save release notes
6360
uses: actions/upload-artifact@v4
6461
with:
6562
name: containerd-release-notes
66-
path: release-notes.md
63+
path: src/github.com/containerd/containerd/release-notes.md
6764

6865
build:
6966
name: Build Release Binaries
@@ -103,7 +100,7 @@ jobs:
103100
# See https://github.com/containerd/containerd/issues/5098 for the context.
104101
repository: ${{ github.repository }}
105102
ref: ${{ github.ref }}
106-
path: .
103+
path: src/github.com/containerd/containerd
107104

108105
- name: Setup buildx instance
109106
uses: docker/setup-buildx-action@v3
@@ -126,14 +123,14 @@ jobs:
126123
127124
# Remove symlinks since we don't want these in the release Artifacts
128125
find ./releases/ -maxdepth 1 -type l | xargs rm
129-
working-directory: .
126+
working-directory: src/github.com/containerd/containerd
130127
env:
131128
PLATFORM: ${{ matrix.dockerfile-platform }}
132129
- name: Save Artifacts
133130
uses: actions/upload-artifact@v4
134131
with:
135132
name: release-tars-${{env.PLATFORM_CLEAN}}
136-
path: releases/*.tar.gz*
133+
path: src/github.com/containerd/containerd/releases/*.tar.gz*
137134

138135
release:
139136
name: Create containerd Release

0 commit comments

Comments
 (0)