-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (79 loc) · 2.57 KB
/
build.yaml
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
name: Build
on:
push:
paths-ignore:
- 'extra/**'
tags:
jobs:
build_release:
name: Build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update rust toolchain
run: rustup toolchain install stable --profile minimal
- name: Restore Rust Cache
uses: Swatinem/rust-cache@v2
- name: Build (Release)
run: cargo build -r
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: bouf-build-${{ matrix.os }}
path: target/release/bouf*
publish_release:
name: Publish Release
needs: build_release
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'repo'
sparse-checkout: 'extra/nsis'
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Package binaries
run: |
zip -j -r9 bouf-windows-${{ github.ref_name }}.zip bouf-build-windows-*/
zip -j -r9 bouf-mac-${{ github.ref_name }}.zip bouf-build-macos-*/
zip -j -r9 bouf-linux-${{ github.ref_name }}.zip bouf-build-ubuntu-*/
zip -j -r9 bouf-nsis-${{ github.ref_name }}.zip repo/extra/nsis
- name: Generate Checksums
run: |
: Generate Checksums
shopt -s extglob
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
for file in ${{ github.workspace }}/@(*.tar.xz|*.zip); do
echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
done
- name: Create Release
id: create_release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
draft: true
prerelease: false
name: Bouf ${{ github.ref_name }}
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/bouf*.zip
tests:
name: Run tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update rust toolchain
run: rustup toolchain install stable --profile minimal
- name: Restore Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run Tests
run: cargo test --bin bouf