-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.57 KB
/
goreleaser.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
---
name: GoReleaser
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
goreleaser:
name: GoReleaser
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Get Details
id: get_details
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::$(git tag --sort=committerdate | tail -1)
echo ::set-output name=GOVERSION::$(cat .go-version)
- name: List tags
run: |
git tag --list
- name: Show variables
run: |
echo $SOURCE_NAME
echo $SOURCE_BRANCH
echo $SOURCE_TAG
env:
SOURCE_NAME: ${{ steps.get_details.outputs.SOURCE_NAME }}
SOURCE_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ steps.get_details.outputs.GOVERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
args: release --rm-dist
env:
CLIENT_VERSION: ${{ steps.get_details.outputs.SOURCE_TAG }}
GO_VERSION: ${{ steps.get_details.outputs.GOVERSION }}
GORELEASER_CURRENT_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }}
GIT_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}