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:
parent
7d3c83d135
commit
43388e84a9
20
.github/scripts/upload_s3.sh
vendored
Normal file
20
.github/scripts/upload_s3.sh
vendored
Normal 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
|
10
.github/workflows/go-release.yml
vendored
10
.github/workflows/go-release.yml
vendored
@ -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]
|
||||||
|
Loading…
Reference in New Issue
Block a user