-
Notifications
You must be signed in to change notification settings - Fork 45
83 lines (75 loc) · 2.6 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (75 loc) · 2.6 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
78
79
80
81
82
83
name: Create Release
on:
workflow_call:
secrets:
token:
required: true
jobs:
Artifacts:
name: ${{ matrix.config.os }} ${{ matrix.config.arch }} binary
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref_name, 'v') && github.ref_type == 'tag'
strategy:
matrix:
config:
# Linux
- {
os: "ubuntu",
arch: "x86-64",
platform: "linux",
archive_ext: "tar",
}
- { os: ubuntu, arch: "arm64", platform: "linux", archive_ext: "tar" }
- {
os: "ubuntu",
arch: "risc-v",
platform: "linux",
archive_ext: "tar",
}
# macOS
- { os: "macos", arch: "x86-64", platform: "mac", archive_ext: "tar" }
- { os: "macos", arch: "arm64", platform: "mac", archive_ext: "tar" }
# Windows (MSYS2 / MinGW)
- {
os: "windows",
archive_ext: "zip",
arch: "x86-64",
platform: "windows",
}
- {
os: "windows",
archive_ext: "zip",
arch: "arm64",
platform: "windows",
}
defaults:
run:
shell: bash {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Download artifact from compilation
uses: actions/download-artifact@v4
with:
name: fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}
path: fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}
- name: Create tar
if: matrix.config.os != 'windows'
run: |
chmod +x ./fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}/fastchess
tar -cvf fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}.tar fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}
- name: Create zip
if: matrix.config.os == 'windows'
run: |
zip -r fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}.zip fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}
- name: Release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
if: github.ref_type == 'tag'
with:
draft: true
generate_release_notes: true
files: fastchess-${{ matrix.config.platform }}-${{ matrix.config.arch }}.${{ matrix.config.archive_ext }}
token: ${{ secrets.token }}