@@ -9,26 +9,9 @@ permissions:
99 contents : write
1010
1111jobs :
12- build-and-release :
13- name : Build & Release (${{ matrix.os }})
14- runs-on : ${{ matrix.os }}
15-
16- strategy :
17- matrix :
18- include :
19- # -----------------------------------------------
20- # Linux build temporarily disabled — uncomment when Linux modules are added
21- # - os: ubuntu-latest
22- # target: x86_64-unknown-linux-gnu
23- # artifact_ext: tar.gz
24- # archive_cmd: tar -czvf
25- # binary_ext: ""
26- # -----------------------------------------------
27- - os : windows-latest
28- target : x86_64-pc-windows-msvc
29- artifact_ext : zip
30- archive_cmd : powershell Compress-Archive -Path
31- binary_ext : " .exe"
12+ release-windows :
13+ name : Build & Release (Windows)
14+ runs-on : windows-latest
3215
3316 steps :
3417 - name : Checkout source
@@ -37,30 +20,24 @@ jobs:
3720 - name : Install Rust
3821 uses : dtolnay/rust-toolchain@stable
3922
40- - name : Build release binary
41- run : cargo build --release --target ${{ matrix.target }}
23+ - name : Build Windows binary
24+ run : cargo build --release --target x86_64-pc-windows-msvc
4225
43- - name : Prepare release assets
26+ - name : Prepare release package
4427 run : |
4528 mkdir release
46- cp README.md release/ 2> NUL || true
47- if [ "${{ matrix.os }}" = "Windows_NT" ]; then
48- # Windows build packaging
49- powershell Copy-Item "target\\${{ matrix.target }}\\release\\magnet.exe" release\\
50- powershell Compress-Archive -Path release\\* -DestinationPath magnet-${{ github.ref_name }}-windows-x86_64.zip
51- else
52- # Linux build packaging (currently disabled)
53- cp target/${{ matrix.target }}/release/magnet release/
54- tar -czvf magnet-${{ github.ref_name }}-linux-x86_64.tar.gz -C release .
55- fi
56- shell : bash
29+ copy README.md release\
30+ copy target\x86_64-pc-windows-msvc\release\magnet.exe release\
31+ powershell Compress-Archive -Path release\* -DestinationPath magnet-${{ github.ref_name }}-windows-x86_64.zip
32+ shell : cmd
33+
34+ - name : Show files for debug
35+ run : dir
36+ shell : cmd
5737
58- - name : Upload release asset
38+ - name : Upload compiled binary to release
5939 uses : softprops/action-gh-release@v2
6040 with :
61- files : |
62- # magnet-${{ github.ref_name }}-linux-x86_64.tar.gz
63- magnet-${{ github.ref_name }}-windows-x86_64.zip
41+ files : magnet-${{ github.ref_name }}-windows-x86_64.zip
6442 env :
6543 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66- if : matrix.os == 'windows-latest' # only upload once (Windows)
0 commit comments