-
Notifications
You must be signed in to change notification settings - Fork 17
52 lines (50 loc) · 1.39 KB
/
release.yml
File metadata and controls
52 lines (50 loc) · 1.39 KB
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
name: release
on:
push:
tags:
- '*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Check Tag
id: check-tag
run: | #
if [[ ${{ github.event.ref }} =~ ^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+(\-rc[0-9]*)?$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
-
name: Checkout
if: steps.check-tag.outputs.match == 'true'
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
if: steps.check-tag.outputs.match == 'true'
uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Docker Login
if: success() && steps.check-tag.outputs.match == 'true'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
-
name: Release
if: steps.check-tag.outputs.match == 'true'
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GH_TOKEN }}
-
name: Clear
if: always() && steps.check-tag.outputs.match == 'true'
run: |
rm -f ${HOME}/.docker/config.json