-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (66 loc) · 1.89 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (66 loc) · 1.89 KB
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
name: Release
permissions:
contents: write
on:
push:
tags:
- 'v*'
workflow_dispatch: # For manual triggering
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for GoReleaser to fetch all tags
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: aarch64-unknown-linux-musl
- name: Cache Cargo registry & index
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-${{ hashFiles('**/Cargo.lock') }}
# Install additional required targets
- name: Add x86_64 GNU target
run: rustup target add x86_64-unknown-linux-gnu
# Update .goreleaser.yml to use pure Rust builder
- name: Update goreleaser config
run: |
cat > .goreleaser.yml << 'EOF'
version: 2
project_name: node-cleaner
builds:
- id: rust-build
builder: rust
dir: .
binary: node-cleaner
targets:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-musl
flags:
- --release
archives:
- id: default
ids:
- rust-build
formats:
- tar.gz
- zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- README.md
- LICENSE
EOF
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}