-
Notifications
You must be signed in to change notification settings - Fork 16
82 lines (64 loc) · 1.84 KB
/
release-binary.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
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
---
name: Create release
on:
push:
branches: ["main", "master"]
# Release whenever this file changes
paths:
- "version.txt"
workflow_dispatch:
permissions:
contents: write
jobs:
generateTag:
name: "Auto-generate Git tag whenever version.txt changes"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch git tags
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: src/wp2hugo/go.sum
- name: Read version name
id: read-version
run: |
echo "version=$(cat ./version.txt)" > "$GITHUB_OUTPUT"
- name: Create new tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
custom_tag: ${{ steps.read-version.outputs.version }}
tag_prefix: "" # To prevent extra "v" in the prefix
github_token: ${{ secrets.GITHUB_TOKEN }}
releaseBinary:
name: "Release Go binaries with Go Releaser"
runs-on: ubuntu-latest
needs: generateTag
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch git tags
run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: src/wp2hugo/go.sum
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}