Skip to content

Commit 05ba3e8

Browse files
authored
fix: release pipeline (#32)
1 parent 2451a9e commit 05ba3e8

File tree

2 files changed

+70
-64
lines changed

2 files changed

+70
-64
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
11
name: Release
22

33
on:
4-
push:
5-
# Trigger this workflow only when you push a tag that starts with "v",
6-
# e.g. "v1.0.0" or "v2.0.0".
7-
tags:
8-
- 'v*.*.*'
4+
push:
5+
# Trigger this workflow only when you push a tag that starts with "v",
6+
# e.g. "v1.0.0" or "v2.0.0".
7+
tags:
8+
- 'v*.*.*'
99

1010
# Add permissions needed for creating releases
1111
permissions:
12-
contents: write
12+
contents: write
1313

1414
jobs:
15-
release:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Check out the repository
19-
uses: actions/checkout@v4
20-
with:
21-
# We fetch all commits & tags so GoReleaser can properly read the tag version
22-
fetch-depth: 0
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out the repository
19+
uses: actions/checkout@v4
20+
with:
21+
# We fetch all commits & tags so GoReleaser can properly read the tag version
22+
fetch-depth: 0
2323

24-
- name: Set up Go
25-
uses: actions/setup-go@v5
26-
with:
27-
go-version: '1.21'
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y gcc g++ make
2828
29-
- name: Run GoReleaser
30-
# The official GoReleaser GitHub Action
31-
uses: goreleaser/goreleaser-action@v4
32-
with:
33-
# By default, it will look for .goreleaser.yml in the repo root
34-
version: latest
35-
args: release
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Set up Go
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version: '1.21'
33+
34+
- name: Run GoReleaser
35+
# The official GoReleaser GitHub Action
36+
uses: goreleaser/goreleaser-action@v4
37+
with:
38+
# By default, it will look for .goreleaser.yml in the repo root
39+
version: latest
40+
args: release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,51 @@
11
version: 2
22

33
before:
4-
hooks:
5-
# If you have tests, uncomment:
6-
- go test ./...
7-
- echo "Starting GoReleaser..."
4+
hooks:
5+
# If you have tests, uncomment:
6+
- go test ./...
7+
- echo "Starting GoReleaser..."
88

99
builds:
10-
- id: filefusion
11-
# If your main.go is in the root folder, use "." or "./".
12-
main: ./cmd/filefusion/main.go
13-
# The base output filename (GoReleaser adds .exe for Windows).
14-
binary: filefusion
15-
# Target OS/Arch combos:
16-
goos:
17-
- linux
18-
- darwin
19-
- windows
20-
goarch:
21-
- amd64
22-
- arm64
23-
# Disable CGO if not needed:
24-
env:
25-
- CGO_ENABLED=0
10+
- id: filefusion
11+
# If your main.go is in the root folder, use "." or "./".
12+
main: ./cmd/filefusion/main.go
13+
# The base output filename (GoReleaser adds .exe for Windows).
14+
binary: filefusion
15+
# Target OS/Arch combos:
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
env:
24+
- CGO_ENABLED=1
25+
flags:
26+
- -tags=bash cpp csharp golang css html java php kotlin javascript ruby python swift typescript sql
2627

2728
archives:
28-
- id: filefusion-archive
29-
# Name format for each archive
30-
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
31-
# Linux & macOS get tar.gz by default; Windows gets .zip
32-
format_overrides:
33-
- goos: windows
34-
format: zip
35-
# Files to include in the archive
36-
files:
37-
- README*
38-
- LICENSE*
39-
allow_different_binary_count: true
29+
- id: filefusion-archive
30+
# Name format for each archive
31+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
32+
# Linux & macOS get tar.gz by default; Windows gets .zip
33+
format_overrides:
34+
- goos: windows
35+
format: zip
36+
# Files to include in the archive
37+
files:
38+
- README*
39+
- LICENSE*
40+
allow_different_binary_count: true
4041

4142
# Publishes a GitHub release for the git tag you push (e.g., v0.0.2).
4243
release:
43-
prerelease: auto
44-
draft: false
45-
name_template: "v{{ .Version }}"
44+
prerelease: auto
45+
draft: false
46+
name_template: 'v{{ .Version }}'
4647

4748
# Generate checksums for the archives
4849
checksum:
49-
name_template: "checksums.txt"
50-
algorithm: sha256
50+
name_template: 'checksums.txt'
51+
algorithm: sha256

0 commit comments

Comments
 (0)