Skip to content

Commit 772acfa

Browse files
committed
fix: release pipeline 2
1 parent 05ba3e8 commit 772acfa

File tree

2 files changed

+52
-23
lines changed

2 files changed

+52
-23
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,43 @@ name: Release
22

33
on:
44
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".
75
tags:
8-
- 'v*.*.*'
6+
- 'v*'
97

10-
# Add permissions needed for creating releases
118
permissions:
129
contents: write
10+
packages: write
1311

1412
jobs:
1513
release:
1614
runs-on: ubuntu-latest
1715
steps:
18-
- name: Check out the repository
16+
- name: Checkout
1917
uses: actions/checkout@v4
2018
with:
21-
# We fetch all commits & tags so GoReleaser can properly read the tag version
2219
fetch-depth: 0
2320

21+
- name: Set up Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version: '1.21'
25+
cache: true
26+
2427
- name: Install dependencies
2528
run: |
2629
sudo apt-get update
2730
sudo apt-get install -y gcc g++ make
31+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
2832
29-
- name: Set up Go
30-
uses: actions/setup-go@v5
31-
with:
32-
go-version: '1.21'
33+
- name: Run tests
34+
run: go test -v ./...
3335

3436
- name: Run GoReleaser
35-
# The official GoReleaser GitHub Action
3637
uses: goreleaser/goreleaser-action@v4
3738
with:
38-
# By default, it will look for .goreleaser.yml in the repo root
39+
distribution: goreleaser
3940
version: latest
40-
args: release
41+
args: release --clean
4142
env:
4243
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
CGO_ENABLED: 1

.goreleaser.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ version: 2
22

33
before:
44
hooks:
5-
# If you have tests, uncomment:
65
- go test ./...
76
- echo "Starting GoReleaser..."
87

98
builds:
109
- id: filefusion
11-
# If your main.go is in the root folder, use "." or "./".
1210
main: ./cmd/filefusion/main.go
13-
# The base output filename (GoReleaser adds .exe for Windows).
1411
binary: filefusion
15-
# Target OS/Arch combos:
1612
goos:
1713
- linux
1814
- darwin
@@ -24,28 +20,59 @@ builds:
2420
- CGO_ENABLED=1
2521
flags:
2622
- -tags=bash cpp csharp golang css html java php kotlin javascript ruby python swift typescript sql
23+
# Add overrides for ARM64 cross-compilation
24+
overrides:
25+
- goos: linux
26+
goarch: arm64
27+
env:
28+
- CC=aarch64-linux-gnu-gcc
29+
- CXX=aarch64-linux-gnu-g++
30+
# Skip Windows ARM64 as it's less commonly used
31+
ignore:
32+
- goos: windows
33+
goarch: arm64
2734

2835
archives:
2936
- 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
37+
name_template: >-
38+
{{ .ProjectName }}_{{ .Version }}_
39+
{{- title .Os }}_
40+
{{- if eq .Arch "amd64" }}x86_64
41+
{{- else if eq .Arch "386" }}i386
42+
{{- else }}{{ .Arch }}{{ end }}
3343
format_overrides:
3444
- goos: windows
3545
format: zip
36-
# Files to include in the archive
3746
files:
3847
- README*
3948
- LICENSE*
4049
allow_different_binary_count: true
4150

42-
# Publishes a GitHub release for the git tag you push (e.g., v0.0.2).
4351
release:
4452
prerelease: auto
4553
draft: false
4654
name_template: 'v{{ .Version }}'
55+
header: |
56+
## FileFusion {{ .Version }}
57+
58+
For full details, see the [documentation](https://github.com/drgsn/filefusion#readme).
59+
footer: |
60+
**Full Changelog**: https://github.com/drgsn/filefusion/compare/{{ .PreviousTag }}...{{ .Tag }}
4761
48-
# Generate checksums for the archives
4962
checksum:
5063
name_template: 'checksums.txt'
5164
algorithm: sha256
65+
66+
# Add changelog configuration
67+
changelog:
68+
sort: asc
69+
filters:
70+
exclude:
71+
- '^docs:'
72+
- '^test:'
73+
- '^ci:'
74+
- Merge pull request
75+
- Merge branch
76+
77+
snapshot:
78+
name_template: '{{ incpatch .Version }}-next'

0 commit comments

Comments
 (0)