Skip to content

Commit ce53d76

Browse files
committed
Refactor release workflow to process artifacts and generate checksums in a dedicated directory
1 parent 40551f2 commit ce53d76

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Release Go Binaries
22

33
on:
44
push:
5-
# tags:
6-
# - 'v*'
5+
tags:
6+
- 'v*'
77

88
permissions:
99
contents: write # Required for creating releases
@@ -117,17 +117,28 @@ jobs:
117117
with:
118118
path: ./artifacts
119119

120-
- name: Generate Checksums
120+
- name: Process Artifacts for Release
121121
run: |
122-
cd ./artifacts
122+
# First look at the directory structure
123+
echo "Initial directory structure:"
124+
find ./artifacts -type f | sort
125+
126+
# Create a directory for processed files
127+
mkdir -p ./release-files
128+
129+
# Find and move all artifact files to the release directory
130+
find ./artifacts -type f -name "*.tar.gz" -o -name "*.zip" | while read file; do
131+
cp "$file" ./release-files/
132+
done
133+
134+
# Generate checksums for the files in release directory
135+
cd ./release-files
136+
echo "Files to be released:"
123137
ls -la
124-
# Move all artifacts to the root artifacts directory
125-
find . -type f -exec sha256sum '{}' \; > checksums.txt
138+
126139
# Generate SHA256 checksums for all artifacts
127140
sha256sum * > checksums.txt
128-
# Display checksums in logs for verification
129141
cat checksums.txt
130-
cd ..
131142
shell: bash
132143

133144
- name: Create GitHub Release
@@ -138,7 +149,6 @@ jobs:
138149
generate_release_notes: true
139150
make_latest: true
140151
files: |
141-
./artifacts/*
142-
./artifacts/checksums.txt
152+
./release-files/*
143153
env:
144154
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)