Skip to content

Commit 6c164b9

Browse files
authored
feat(release): upload releases to GCS bucket (#12)
1 parent 81a5045 commit 6c164b9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/tag-release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@ jobs:
2323
run: hack/tag-release.sh
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Sign in to Google Cloud
28+
uses: google-github-actions/auth@v2
29+
with:
30+
credentials_json: ${{ secrets.GOOGLE_BUCKET_CREDS_JSON }}
31+
32+
- name: Upload archive to Google Bucket
33+
uses: 'google-github-actions/upload-cloud-storage@v2'
34+
with:
35+
path: dist
36+
glob: '*.tar.gz'
37+
parent: false
38+
destination: 'codesphere-oms-builds/tag/oms-${{ env.RELEASE_VERSION }}/${{ env.FOLDER }}'

hack/tag-release.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ git push origin "$NEWTAG"
5454
echo "Triggering release of version $NEWTAG"
5555
go install github.com/goreleaser/goreleaser/v2@latest
5656
goreleaser release --clean
57+
58+
cd dist
59+
for ARCH in darwin_arm64 darwin_amd64 linux_amd64 linux_arm64; do
60+
tar cf $ARCH.tar.gz *$ARCH*/* CHANGELOG.md
61+
done
62+
cd ..
63+
64+
echo "RELEASE_VERSION=$NEWTAG" >> $GITHUB_ENV
65+
66+
# Hash length fixed to 10 characters to get deterministic folder names
67+
FOLDER="$(git rev-parse --short=10 HEAD)"
68+
echo "FOLDER=$FOLDER" >> $GITHUB_ENV

0 commit comments

Comments
 (0)