-
Notifications
You must be signed in to change notification settings - Fork 135
103 lines (91 loc) · 3.1 KB
/
package-binary.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
name: Packaging
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
name: Publish on ${{ matrix.os }} for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
compress: true
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
compress: true
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
compress: true
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
compress: true
- os: ubuntu-latest
target: x86_64-unknown-freebsd
compress: false
- os: windows-latest
target: x86_64-pc-windows-msvc
compress: false
- os: macos-latest
target: x86_64-apple-darwin
compress: false
- os: macos-latest
target: aarch64-apple-darwin
compress: false
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- run: sudo apt install musl-tools
if: startsWith(matrix.os, 'ubuntu')
- name: cargo build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
args: --release --locked
target: ${{ matrix.target }}
- name: Set exe extension for Windows
run: echo "EXE=.exe" >> $env:GITHUB_ENV
if: startsWith(matrix.os, 'windows')
- name: Compress client
uses: svenstaro/upx-action@v2
with:
file: target/${{ matrix.target }}/release/pueue${{ env.EXE }}
args: --best --lzma
strip: false
if: ${{ matrix.compress }}
- name: Compress daemon
uses: svenstaro/upx-action@v2
with:
file: target/${{ matrix.target }}/release/pueued${{ env.EXE }}
args: --best --lzma
strip: false
if: ${{ matrix.compress }}
- name: Upload client binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/pueue${{ env.EXE }}
asset_name: pueue-${{ matrix.target }}${{ env.EXE }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload daemon binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/pueued${{ env.EXE }}
asset_name: pueued-${{ matrix.target }}${{ env.EXE }}
tag: ${{ github.ref }}
overwrite: true
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: utils/pueued.service
tag: ${{ github.ref }}
asset_name: systemd.pueued.service
body: ${{ steps.changelog_reader.outputs.log_entry }}
if: matrix.target == 'x86_64-unknown-linux-musl'