1
0
mirror of https://github.com/zu1k/nali.git synced 2025-01-22 13:19:02 +08:00

chore: Upload binaries to s3

Signed-off-by: zu1k <i@zu1k.com>
This commit is contained in:
zu1k 2022-07-24 13:20:51 +08:00
parent 7d3c83d135
commit 43388e84a9
No known key found for this signature in database
GPG Key ID: AE381A8FB1EF2CC8
2 changed files with 30 additions and 0 deletions

20
.github/scripts/upload_s3.sh vendored Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
set -e
aws configure --profile s3 <<-EOF > /dev/null 2>&1
${S3_ACCESS_KEY_ID}
${S3_SECRET_ACCESS_KEY}
auto
text
EOF
VERSION=$(git describe --tags || echo "unknown version")
aws s3 cp bin s3://$S3_BUCKET/$VERSION/ --profile s3 --no-progress --endpoint-url $S3_ENDPOINT --recursive
aws configure --profile s3 <<-EOF > /dev/null 2>&1
null
null
null
text
EOF

View File

@ -7,6 +7,7 @@ jobs:
release-binary: release-binary:
name: Release Binary name: Release Binary
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: s3
steps: steps:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
@ -51,6 +52,15 @@ jobs:
name: build name: build
path: bin path: bin
- name: Upload to s3
if: startsWith(github.ref, 'refs/tags/')
run: sh .github/scripts/upload_s3.sh
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
release-aur-bin: release-aur-bin:
name: Release Aur bin name: Release Aur bin
needs: [release-binary] needs: [release-binary]