-
Notifications
You must be signed in to change notification settings - Fork 46
63 lines (51 loc) · 2.68 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: Build linux amd64
run: env CGO_ENABLED=0 go build -o geesefs-linux-amd64 -v && ln -s geesefs-linux-amd64 geesefs
- name: Build linux arm64
run: env CGO_ENABLED=0 GOARCH=arm64 go build -o geesefs-linux-arm64 -v
- name: Build Mac amd64
run: env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o geesefs-mac-amd64 -v
- name: Build Mac arm64
run: env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o geesefs-mac-arm64 -v
- name: Build Windows x64
run: env CGO_ENABLED=0 GOOS=windows go build -o geesefs-win-x64.exe -v
- name: Build tests
run: go test -c github.com/yandex-cloud/geesefs/internal -o geesefs-tests-linux-amd64
- name: Publish to S3
run: |
sudo apt-get -y install s3cmd
s3cmd ${{secrets.S3CMD}} put geesefs-linux-amd64 s3://${{secrets.S3BUCKET}}/geesefs-linux-amd64
s3cmd ${{secrets.S3CMD}} put geesefs-linux-arm64 s3://${{secrets.S3BUCKET}}/geesefs-linux-arm64
s3cmd ${{secrets.S3CMD}} put geesefs-mac-amd64 s3://${{secrets.S3BUCKET}}/geesefs-mac-amd64
s3cmd ${{secrets.S3CMD}} put geesefs-mac-arm64 s3://${{secrets.S3BUCKET}}/geesefs-mac-arm64
s3cmd ${{secrets.S3CMD}} put geesefs-win-x64.exe s3://${{secrets.S3BUCKET}}/geesefs-win-x64.exe
s3cmd ${{secrets.S3CMD}} put geesefs-tests-linux-amd64 s3://${{secrets.S3BUCKET}}/geesefs-tests-linux-amd64
s3cmd ${{secrets.S3CMD}} put geesefs-linux-amd64 s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-linux-amd64
s3cmd ${{secrets.S3CMD}} put geesefs-linux-arm64 s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-linux-arm64
s3cmd ${{secrets.S3CMD}} put geesefs-mac-amd64 s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-mac-amd64
s3cmd ${{secrets.S3CMD}} put geesefs-mac-arm64 s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-mac-arm64
s3cmd ${{secrets.S3CMD}} put geesefs-win-x64.exe s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-win-x64.exe
s3cmd ${{secrets.S3CMD}} put geesefs-tests-linux-amd64 s3://${{secrets.S3BUCKET}}/${GITHUB_REF/refs\/tags\/v/}/geesefs-tests-linux-amd64
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
geesefs-linux-amd64
geesefs-linux-arm64
geesefs-mac-amd64
geesefs-mac-arm64
geesefs-win-x64.exe