Skip to content

Commit 7630c01

Browse files
committed
..
1 parent 222b8dd commit 7630c01

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,67 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags
77

88
jobs:
99
release:
10-
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
13-
issues: write
14-
pull-requests: write
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, windows-latest, macos-latest]
13+
runs-on: ${{ matrix.os }}
1514
steps:
16-
- name: Checkout Repository
17-
uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1816
with:
1917
fetch-depth: 0
2018

2119
- name: Set up Go
22-
uses: actions/setup-go@v4
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.21.x'
23+
24+
- name: Install dependencies
25+
run: go mod download
26+
27+
- name: Run tests
28+
run: go test -v ./...
29+
30+
- name: Build
31+
env:
32+
GOOS: ${{ matrix.os == 'windows-latest' && 'windows' || matrix.os == 'macos-latest' && 'darwin' || 'linux' }}
33+
GOARCH: amd64
34+
run: go build -v -o cpp2py ./cmd/cpp2py
35+
36+
- name: Upload artifact
37+
uses: actions/upload-artifact@v4
2338
with:
24-
go-version: '1.23'
25-
26-
- name: Build for Multiple Platforms
27-
run: |
28-
mkdir -p releases
29-
PLATFORMS=("windows/amd64" "linux/amd64" "linux/arm64" "darwin/amd64")
30-
for platform in "${PLATFORMS[@]}"; do
31-
OS=${platform%/*}
32-
ARCH=${platform#*/}
33-
output_name="releases/tinyass-${OS}-${ARCH}"
34-
if [ $OS = "windows" ]; then
35-
output_name="$output_name.exe"
36-
fi
37-
GOOS=$OS GOARCH=$ARCH go build -o "$output_name" .
38-
done
39-
40-
- name: Generate Next Version
41-
id: semver
42-
uses: mathieudutour/github-tag-action@v6.1
39+
name: cpp2py-${{ matrix.os }}
40+
path: cpp2py
41+
42+
create-release:
43+
needs: release
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Download artifacts
51+
uses: actions/download-artifact@v4
4352
with:
44-
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
dry_run: true
53+
path: artifacts
54+
pattern: cpp2py-*
4655

4756
- name: Create Release
4857
uses: softprops/action-gh-release@v1
4958
with:
50-
tag_name: ${{ steps.semver.outputs.new_tag }}
51-
name: Release ${{ steps.semver.outputs.new_tag }}
52-
body: ${{ steps.semver.outputs.changelog }}
5359
files: |
54-
releases/*
60+
artifacts/cpp2py-ubuntu-latest
61+
artifacts/cpp2py-windows-latest
62+
artifacts/cpp2py-macos-latest
63+
draft: false
64+
prerelease: false
65+
generate_release_notes: true
5566
env:
5667
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)