-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (47 loc) · 1.37 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: |
./setup.sh
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Tag
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
tag='${{ github.event.inputs.version }}'
git tag --annotate --message "Tag for release $tag" "$tag"
git push origin "refs/tags/$tag"
- name: Test
run: |
mage -v test
- name: Release
run: |
echo "$DOCKER_TOKEN" | docker login --username "$DOCKER_USERNAME" --password-stdin docker.io
mage -v release
env:
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}