1- name : Build&Publish
1+ name : Release
2+
3+ permissions : write-all
24
35on :
4- release :
5- types : [created]
6+ push :
7+ tags :
8+ - ' v*.*.*'
69
710jobs :
811 release :
9- name : release ${{ matrix.target }}
10- runs-on : ubuntu-latest
1112 strategy :
12- fail-fast : false
1313 matrix :
1414 include :
15- - target : x86_64-pc-windows-gnu
16- archive : zip
15+ - os : windows-latest
16+ target : x86_64-pc-windows-msvc
17+ code-target : win32-x64
18+ binary_postfix : " .exe"
19+ - os : windows-latest
20+ target : i686-pc-windows-msvc
21+ code-target : win32-ia32
22+ binary_postfix : " .exe"
23+ name : release for ${{ matrix.target }}
24+ runs-on : ${{ matrix.os }}
1725 steps :
26+ - id : get_version
27+ uses : battila7/get-version-action@v2
28+ - name : Configure Rust Target
29+ run : |
30+ rustup update
31+ rustup target add ${{ matrix.target }}
1832 - uses : actions/checkout@v3
19- - name : Compile
20- id : compile
21- uses :
rust-build/[email protected] 22- env :
23- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33+ - name : Build release for ${{ matrix.target }}
34+ run : cargo build --release --target=${{ matrix.target }}
35+ - name : Packaging binary
36+ run : |
37+ 7z a thunk-${{ steps.get_version.outputs.version }}-${{ matrix.code-target }}.zip ./target/${{ matrix.target }}/release/thunk${{ matrix.binary_postfix }} ./LICENSE ./README.md ./readme-chinese.md
38+ - name : Calculate Sha256 (Windows)
39+ if : matrix.os == 'windows-latest'
40+ shell : bash
41+ run : |
42+ sha256sum thunk-${{ steps.get_version.outputs.version }}-${{ matrix.code-target }}.zip > thunk-${{ steps.get_version.outputs.version }}-${{ matrix.code-target }}.zip.sha256sum
43+ - name : Upload binaries to release
44+ uses : svenstaro/upload-release-action@v2
2445 with :
25- RUSTTARGET : ${{ matrix.target }}
26- TOOLCHAIN_VERSION : stable
27- EXTRA_FILES : " README.md readme-chinese.md LICENSE "
28- ARCHIVE_TYPES : ${{ matrix.archive }}
29- UPLOAD_MODE : release
46+ repo_token : ${{ secrets.GITHUB_TOKEN }}
47+ file : thunk-*.zip*
48+ file_glob : true
49+ tag : ${{ github.ref }}
50+ overwrite : true
0 commit comments