6
6
jobs :
7
7
build :
8
8
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
+
10
17
steps :
11
18
- name : Clone project
12
19
uses : actions/checkout@v3
@@ -31,39 +38,68 @@ jobs:
31
38
run : |
32
39
cargo build --release
33
40
34
- - name : Prepare binary
41
+ - name : Prepare target name
35
42
id : prepare
36
43
run : |
37
44
case "${{ runner.os }}" in
38
45
Linux)
39
46
OS="linux"
40
47
;;
41
- Windows)
42
- OS="windows"
43
- ;;
44
48
macOS)
45
- OS="macos "
49
+ OS="darwin "
46
50
;;
47
- * )
48
- OS="${{ runner.os }} "
51
+ Windows )
52
+ OS="windows "
49
53
;;
50
54
esac
51
55
52
56
case "${{ runner.arch }}" in
57
+ ARM)
58
+ ARCH="arm"
59
+ ;;
60
+ ARM64)
61
+ ARCH="aarch64"
62
+ ;;
53
63
X64)
54
64
ARCH="x86_64"
55
65
;;
66
+ X86)
67
+ ARCH="i686"
68
+ ;;
56
69
*)
57
70
ARCH="${{ runner.arch }}"
58
71
;;
59
72
esac
60
73
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
+ id : compress
90
+ if : runner.os != 'Windows'
91
+ run : |
92
+ gzip -c target/release/technique > ${{ steps.prepare.outputs.target }}
93
+
94
+ - name : Compress binary (Windows)
95
+ id : compress
96
+ if : runner.os == 'Windows'
97
+ shell : pwsh
98
+ run : |
99
+ Compress-Archive -Path target/release/technique.exe -DestinationPath ${{ steps.prepare.outputs.target }}
64
100
65
101
- name : Upload binary to Release
66
102
uses : softprops/action-gh-release@v2
67
103
with :
68
104
tag_name : ${{ github.ref_name }}
69
- files : ${{ steps.prepare.outputs.binary }}
105
+ files : ${{ steps.prepare.outputs.target }}
0 commit comments