Skip to content

Commit a2c9ff8

Browse files
authored
Merge pull request #43 from ponkio-o/feat/added-goreleaser
feat: added GoRereleaser
2 parents dc7522d + 2c1726d commit a2c9ff8

File tree

7 files changed

+143
-116
lines changed

7 files changed

+143
-116
lines changed

.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,42 @@ jobs:
105105
push: true
106106
cache-from: type=gha
107107
cache-to: type=gha,mode=max
108+
109+
release-binaries:
110+
name: Build and release binaries
111+
runs-on: ubuntu-latest
112+
permissions:
113+
# Required to write release assets
114+
contents: write
115+
116+
steps:
117+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
118+
with:
119+
submodules: recursive
120+
121+
- name: Install aqua
122+
uses: aquaproj/aqua-installer@4551ec64e21bf0f557c2525135ff0bd2cba40ec7 # v3.0.0
123+
with:
124+
aqua_version: v2.27.3
125+
126+
- uses: nowsprinting/check-version-format-action@98485692a883d962227b09f40f29a63de0771299 # v4.0.2
127+
id: version
128+
with:
129+
prefix: "v"
130+
131+
- name: Create pre-release
132+
if: steps.version.outputs.is_stable != 'true'
133+
run: gh release create --prerelease --title ${{ github.ref_name }} ${{ github.ref_name }}
134+
env:
135+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
137+
- name: Create release
138+
if: steps.version.outputs.is_stable == 'true'
139+
run: gh release create --latest --title ${{ github.ref_name }} ${{ github.ref_name }}
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
143+
- name: Run goreleaser
144+
run: goreleaser release --clean
145+
env:
146+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tmp
2+
dist
23
out
34
.env
45
# Created by https://www.toptal.com/developers/gitignore/api/go

.goreleaser.yaml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
version: 1
2+
3+
builds:
4+
- id: unity-meta-check
5+
binary: unity-meta-check
6+
main: ./main.go
7+
env:
8+
- CGO_ENABLED=0
9+
goos:
10+
- linux
11+
- windows
12+
- darwin
13+
goarch:
14+
- amd64
15+
- arm64
16+
- id: unity-meta-check-junit
17+
binary: unity-meta-check-junit
18+
main: ./tool/unity-meta-check-junit
19+
env:
20+
- CGO_ENABLED=0
21+
goos:
22+
- linux
23+
- windows
24+
- darwin
25+
goarch:
26+
- amd64
27+
- arm64
28+
- id: gh-action
29+
binary: gh-action
30+
main: ./tool/gh-action
31+
env:
32+
- CGO_ENABLED=0
33+
goos:
34+
- linux
35+
goarch:
36+
- amd64
37+
- arm64
38+
- id: gh-action-yaml-gen
39+
binary: gh-action-yaml-gen
40+
main: ./tool/gh-action/action-yaml-gen
41+
env:
42+
- CGO_ENABLED=0
43+
goos:
44+
- linux
45+
- windows
46+
- darwin
47+
goarch:
48+
- amd64
49+
- arm64
50+
- id: unity-meta-autofix
51+
binary: unity-meta-autofix
52+
main: ./tool/unity-meta-autofix
53+
env:
54+
- CGO_ENABLED=0
55+
goos:
56+
- linux
57+
- windows
58+
- darwin
59+
goarch:
60+
- amd64
61+
- arm64
62+
- id: unity-meta-check-github-pr-comment
63+
binary: unity-meta-check-github-pr-comment
64+
main: ./tool/unity-meta-check-github-pr-comment
65+
env:
66+
- CGO_ENABLED=0
67+
goos:
68+
- linux
69+
- windows
70+
- darwin
71+
goarch:
72+
- amd64
73+
- arm64
74+
75+
archives:
76+
- format: binary
77+
name_template: >-
78+
{{ .Binary }}-
79+
{{- if eq .Os "Darwin" }}darwin-
80+
{{- else if eq .Os "Linux" }}linux-
81+
{{- else }}{{ .Os }}{{ end }}-{{ .Arch }}
82+
# https://goreleaser.com/errors/multiple-binaries-archive/
83+
allow_different_binary_count: true
84+
85+
checksum:
86+
name_template: "checksums.txt"
87+
88+
release:
89+
prerelease: auto

aqua.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# aqua - Declarative CLI Version Manager
3+
# https://aquaproj.github.io/
4+
# checksum:
5+
# enabled: true
6+
# require_checksum: true
7+
# supported_envs:
8+
# - all
9+
registries:
10+
- type: standard
11+
ref: v4.166.0 # renovate: depName=aquaproj/aqua-registry
12+
packages:
13+
- name: goreleaser/[email protected]
14+
- name: cli/[email protected]

scripts/deploy

-4
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@ usage-error() {
4343

4444
main() {
4545
has go || throw "'go' must be installed (see https://golang.org)"
46-
has gh || throw "'gh' must be installed (see https://cli.github.com)"
47-
has docker || throw "'docker' must be installed (see https://www.docker.com)"
4846

4947
local version
5048
version="$("$BASE_DIR/scripts/print-version")"
5149

52-
gh auth status
5350
go test ./...
5451

5552
local tag="v${version}"
@@ -60,7 +57,6 @@ main() {
6057
git tag "$tag"
6158

6259
(cd "$BASE_DIR"
63-
./scripts/deploy-gh-release
6460
./scripts/deploy-bins
6561
)
6662
}

scripts/deploy-gh-release

-108
This file was deleted.

scripts/is-prerelease

-4
This file was deleted.

0 commit comments

Comments
 (0)