-
Notifications
You must be signed in to change notification settings - Fork 18
89 lines (75 loc) · 2.21 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
name: Release
on:
push:
branches:
- master
tags:
- '*'
env:
GO_VERSION: '>=1.21.5'
GORELEASER_VERSION: v0.146.0
jobs:
create-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Setup GoReleaser
run: |
curl -O -L https://github.com/goreleaser/goreleaser/releases/download/${{ env.GORELEASER_VERSION }}/goreleaser_amd64.deb
sudo dpkg -i goreleaser_amd64.deb
rm goreleaser_amd64.deb
- name: Set GoReleaser flags
id: set-goreleaser-flags
run: |
if ${{ startsWith(github.ref, 'refs/tags') }} ; then
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --skip-validate"
else
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --snapshot --skip-publish --skip-validate"
fi
- name: Build packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
goreleaser release ${{ steps.set-goreleaser-flags.outputs.GORELEASER_FLAGS }}
- name: Upload packages artifacts
uses: actions/upload-artifact@v2
with:
name: packages
path: dist
publish-s3:
needs: create-packages
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@master
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Download packages artifacts
uses: actions/download-artifact@v2
with:
name: packages
path: dist
- name: Publish packages to RWS
env:
RWS_URL_PART: https://rws.tarantool.org/release/modules
RWS_AUTH: ${{ secrets.RWS_AUTH }}
run: mage publishRWS