Skip to content

Commit 77894b5

Browse files
authored
Merge pull request #25 from IBM/jo5ta/dev
Fix release workflow permission issue
2 parents f71b69b + 807e2cf commit 77894b5

File tree

2 files changed

+37
-24
lines changed

2 files changed

+37
-24
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -129,39 +129,50 @@ jobs:
129129
env:
130130
COMMIT_SHA: ${{ github.sha }}
131131
run: |
132+
set -e
133+
132134
VERSION=$(head -n1 VERSION.md)
133135
echo "version=$VERSION" >> $GITHUB_OUTPUT
134136
135137
# Create a unique tag using version + short commit hash
136138
SHORT_SHA=$(echo "$COMMIT_SHA" | cut -c1-7)
137-
echo "tag=v${VERSION}+${SHORT_SHA}" >> $GITHUB_OUTPUT
139+
echo "tag=v${VERSION}-${SHORT_SHA}" >> $GITHUB_OUTPUT
138140
139141
# Find packages directory (container.sh puts it under build/in_container/*/build/packages)
140142
PACKAGES_DIR=$(find build -type d -name packages | head -1)
141-
echo "packages_dir=$PACKAGES_DIR" >> $GITHUB_OUTPUT
143+
if [ -z "$PACKAGES_DIR" ]; then
144+
echo "ERROR: No packages directory found"
145+
exit 1
146+
fi
147+
148+
# Check that SRPM exists
149+
if ! ls "$PACKAGES_DIR"/*.src.rpm 1>/dev/null 2>&1; then
150+
echo "ERROR: No SRPM found in $PACKAGES_DIR"
151+
exit 1
152+
fi
142153
143-
# Generate checksums
144-
cd "$PACKAGES_DIR"
154+
# Copy SRPM to current directory and generate checksums there
155+
# (packages dir may be owned by root from container)
156+
cp "$PACKAGES_DIR"/*.src.rpm .
145157
sha256sum *.src.rpm > SHA256SUMS
146158
147159
# Build release body with checksums embedded
148-
cd -
149-
cat > release_body.md << EOF
150-
Release of Common Low Level Tracing Kit
151-
152-
**Commit:** ${COMMIT_SHA}
153-
154-
## Install from SRPM
155-
\`\`\`bash
156-
rpmbuild --rebuild clltk-${VERSION}-*.src.rpm
157-
sudo dnf install ~/rpmbuild/RPMS/x86_64/clltk-*.rpm
158-
\`\`\`
159-
160-
## Checksums (SHA256)
161-
\`\`\`
162-
$(cat "$PACKAGES_DIR/SHA256SUMS")
163-
\`\`\`
164-
EOF
160+
{
161+
echo "Release of Common Low Level Tracing Kit"
162+
echo ""
163+
echo "**Commit:** ${COMMIT_SHA}"
164+
echo ""
165+
echo "## Install from SRPM"
166+
echo "\`\`\`bash"
167+
echo "rpmbuild --rebuild clltk-${VERSION}-*.src.rpm"
168+
echo "sudo dnf install ~/rpmbuild/RPMS/x86_64/clltk-*.rpm"
169+
echo "\`\`\`"
170+
echo ""
171+
echo "## Checksums (SHA256)"
172+
echo "\`\`\`"
173+
cat SHA256SUMS
174+
echo "\`\`\`"
175+
} > release_body.md
165176
166177
- name: Create Release
167178
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -171,5 +182,5 @@ jobs:
171182
name: ${{ steps.release_info.outputs.version }}
172183
body_path: release_body.md
173184
files: |
174-
${{ steps.release_info.outputs.packages_dir }}/*.src.rpm
175-
${{ steps.release_info.outputs.packages_dir }}/SHA256SUMS
185+
*.src.rpm
186+
SHA256SUMS

VERSION.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
1.2.60
1+
1.2.61
22

33
# Change log
4+
## 1.2.61
5+
- fix: release workflow copies SRPM to workspace before creating checksums
46
## 1.2.60
57
- fix: release workflow now finds packages in correct container output path
68
## 1.2.59

0 commit comments

Comments
 (0)