Skip to content

Commit b8564ad

Browse files
committed
.github/workflows: inject version into source release artifact
Updates #671 Updates golang/go#77020
1 parent e4c611f commit b8564ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ jobs:
8686
mkdir "$DIR/age"
8787
git archive --format=tar.gz HEAD | tar -xz -C "$DIR/age"
8888
( cd "$DIR/age"; go mod vendor )
89+
for cmd in "$DIR"/age/{cmd,extra}/*; do
90+
echo "package main" >> "$cmd/version.go"
91+
echo "" >> "$cmd/version.go"
92+
echo "func init() { Version = \"$VERSION\" }" >> "$cmd/version.go"
93+
done
8994
tar -cvzf "age-$VERSION-source.tar.gz" -C "$DIR" age
9095
- name: Upload workflow artifacts
9196
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)