.github/workflows: inject version into source release artifact

Updates #671
Updates golang/go#77020
This commit is contained in:
Filippo Valsorda
2025-12-28 12:56:14 +01:00
parent e4c611f778
commit b8564adb6d

View File

@@ -86,6 +86,11 @@ jobs:
mkdir "$DIR/age"
git archive --format=tar.gz HEAD | tar -xz -C "$DIR/age"
( cd "$DIR/age"; go mod vendor )
for cmd in "$DIR"/age/{cmd,extra}/*; do
echo "package main" >> "$cmd/version.go"
echo "" >> "$cmd/version.go"
echo "func init() { Version = \"$VERSION\" }" >> "$cmd/version.go"
done
tar -cvzf "age-$VERSION-source.tar.gz" -C "$DIR" age
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4