-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (124 loc) · 4.07 KB
/
release.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Release
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
- 'README.md'
- 'LICENSE'
- '.gitignore'
- 'CONTRIBUTING'
workflow_dispatch:
jobs:
build_test_and_bundle:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: setup rust stable
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: unit tests
run: |
cargo test --all --release
- name: bundle
shell: bash
run: |
mkdir psv
cp target/release/psv psv/psv-${{ matrix.os }}
cp target/release/psv-server psv/psv-server-${{ matrix.os }}
cp LICENSE psv/
- name: upload bundle
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: psv
build_test_and_bundle_arm:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: setup rust stable
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
rustup target add armv7-unknown-linux-gnueabi
rustup target add aarch64-unknown-linux-gnu
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi
- name: unit tests
run: |
cargo build --release --target armv7-unknown-linux-gnueabi
cargo build --release --target aarch64-unknown-linux-gnu
- name: bundle
shell: bash
run: |
mkdir psv-armv7
cp target/armv7-unknown-linux-gnueabi/release/psv psv-armv7/psv-armv7
cp target/armv7-unknown-linux-gnueabi/release/psv-server psv-armv7/psv-server-armv7
cp LICENSE psv-armv7/
mkdir psv-aarch64
cp target/aarch64-unknown-linux-gnu/release/psv psv-aarch64/psv-aarch64
cp target/aarch64-unknown-linux-gnu/release/psv-server psv-aarch64/psv-server-aarch64
cp LICENSE psv-aarch64/
- name: upload bundle
uses: actions/upload-artifact@v4
with:
name: armv7
path: psv-armv7
- name: upload bundle
uses: actions/upload-artifact@v4
with:
name: aarch64
path: psv-aarch64
release:
needs: [build_test_and_bundle, build_test_and_bundle_arm]
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
steps:
- name: get linux build
uses: actions/download-artifact@v4
with:
name: ubuntu-20.04
- name: get windows build
uses: actions/download-artifact@v4
with:
name: windows-latest
- name: get macos build
uses: actions/download-artifact@v4
with:
name: macos-latest
- name: get armv7 build
uses: actions/download-artifact@v4
with:
name: armv7
- name: get aarch64 build
uses: actions/download-artifact@v4
with:
name: aarch64
- name: pack
run: |
mkdir linux windows macos armv7 aarch64
ls
mv psv-ubuntu-20.04 psv-linux-x86_64
mv psv-server-ubuntu-20.04 psv-server-linux-x86_64
for arch in linux-x86_64 macos-latest armv7 aarch64; do mv psv-$arch psv && mv psv-server-$arch psv-server && chmod +x psv && chmod +x psv-server && tar -cvf psv-$arch.tar.gz psv psv-server LICENSE; done
mv psv-macos-latest.tar.gz psv-macOS.tar.gz
mv psv-windows-latest.exe psv.exe
mv psv-server-windows-latest.exe psv-server.exe
zip psv-windows.zip psv.exe psv-server.exe LICENSE
ls
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: |
psv-linux-x86_64.tar.gz
psv-windows.zip
psv-macOS.tar.gz
psv-armv7.tar.gz
psv-aarch64.tar.gz