forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (56 loc) · 1.87 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
name: Release
on:
push:
branches:
- master
jobs:
release:
name: releaser
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.16.x]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Unshallow
run: git fetch --prune --unshallow
- name: Run Semantic Release
id: semantic
uses: docker://ghcr.io/codfish/semantic-release-action:v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install libgl
if: steps.semantic.outputs.new-release-published == 'true'
run: |
sudo apt update
sudo apt install -f
sudo apt install -f -y libgl1-mesa-glx libgl1-mesa-dev xorg-dev
- name: Set up Go
if: steps.semantic.outputs.new-release-published == 'true'
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Cache Go modules
if: steps.semantic.outputs.new-release-published == 'true'
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-v1-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang }}-v1-
- name: Run GoReleaser
if: steps.semantic.outputs.new-release-published == 'true'
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Register version on pkg.go.dev
if: steps.semantic.outputs.new-release-published == 'true'
run: |
package=$(cat go.mod | grep ^module | awk '{print $2}')
version=v${{ steps.semantic.outputs.release-version }}
url=https://proxy.golang.org/${package}/@v/${version}.info
set -x +e
curl -i $url