-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (75 loc) · 2.27 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
name: Release
on:
push:
branches:
- master
- test/release
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
steps:
# checkout code
- uses: actions/checkout@v4
# install just
- uses: extractions/setup-just@v1
# install rust
- run: rustup show && rustup target add ${{ matrix.target }}
# install dependencies
- run: just setup
# build (generates binaries)
- run: just build --locked --release --target=${{ matrix.target }}
- run: cargo test --release --locked manpage
# create archive
- name: Archive
shell: bash
run: |
staging="istat-${{ matrix.target }}"
mkdir "$staging"
cp -a "doc/*" "$staging"
files=(
"target/${{ matrix.target }}/release/istat"
"target/${{ matrix.target }}/release/istat-ipc"
"target/${{ matrix.target }}/release/istat-acpi"
"target/${{ matrix.target }}/release/istat-sensors"
"target/${{ matrix.target }}/release/istat-signals"
"README.md"
"sample_config.toml"
"sample_included_config.toml"
"LICENSE"
)
for file in ${files[@]}; do
cp $file "$staging"
done
zip "$staging.zip" "$staging"
# upload zip as an artifact (as a folder called `artifact`)
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: artifacts
path: istat-${{ matrix.target }}.zip
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
# downloads artifacts (this downloads the folder called `artifacts` defined above)
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: .
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/istat-x86_64-unknown-linux-gnu.zip
tag_name: ${{ github.run_number }}
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}