66jobs :
77 build :
88 name : Build and Upload
9- runs-on : ubuntu-latest
9+ runs-on : ${{ matrix.os }}
10+ strategy :
11+ matrix :
12+ include :
13+ - os : ubuntu-latest
14+ - os : macos-latest
15+ - os : windows-latest
16+
1017 steps :
1118 - name : Clone project
1219 uses : actions/checkout@v3
@@ -31,39 +38,66 @@ jobs:
3138 run : |
3239 cargo build --release
3340
34- - name : Prepare binary
41+ - name : Prepare target name
3542 id : prepare
3643 run : |
3744 case "${{ runner.os }}" in
3845 Linux)
3946 OS="linux"
4047 ;;
41- Windows)
42- OS="windows"
43- ;;
4448 macOS)
45- OS="macos "
49+ OS="darwin "
4650 ;;
47- * )
48- OS="${{ runner.os }} "
51+ Windows )
52+ OS="windows "
4953 ;;
5054 esac
5155
5256 case "${{ runner.arch }}" in
57+ ARM)
58+ ARCH="arm"
59+ ;;
60+ ARM64)
61+ ARCH="aarch64"
62+ ;;
5363 X64)
5464 ARCH="x86_64"
5565 ;;
66+ X86)
67+ ARCH="i686"
68+ ;;
5669 *)
5770 ARCH="${{ runner.arch }}"
5871 ;;
5972 esac
6073
61- TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz"
62- gzip -c target/release/technique > ${TARGET}
63- echo "binary=${TARGET}" >> $GITHUB_OUTPUT
74+ case "${{ runner.os }}" in
75+ Linux)
76+ TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz"
77+ ;;
78+ macOS)
79+ TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.gz"
80+ ;;
81+ Windows)
82+ TARGET="technique-${{ github.ref_name }}-${OS}-${ARCH}.zip"
83+ ;;
84+ esac
85+
86+ echo "target=${TARGET}" >> $GITHUB_OUTPUT
87+
88+ - name : Compress binary (Unix)
89+ if : runner.os != 'Windows'
90+ run : |
91+ gzip -c target/release/technique > ${{ steps.prepare.outputs.target }}
92+
93+ - name : Compress binary (Windows)
94+ if : runner.os == 'Windows'
95+ shell : pwsh
96+ run : |
97+ Compress-Archive -Path target/release/technique.exe -DestinationPath ${{ steps.prepare.outputs.target }}
6498
6599 - name : Upload binary to Release
66100 uses : softprops/action-gh-release@v2
67101 with :
68102 tag_name : ${{ github.ref_name }}
69- files : ${{ steps.prepare.outputs.binary }}
103+ files : ${{ steps.prepare.outputs.target }}
0 commit comments