-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 2.33 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
on:
push:
tags:
- "*"
jobs:
build:
name: Build
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Install packages
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install libgtk-3-dev
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Release build
run: cargo build --release
- run: |
chmod +x lanquetta
tar czf lanquetta-${{ matrix.target }}.tar.gz lanquetta
working-directory: target/release
if: matrix.target == 'x86_64-unknown-linux-gnu'
- run: |
7z a lanquetta-${{ matrix.target }}.zip lanquetta.exe
working-directory: target/release
if: matrix.target == 'x86_64-pc-windows-msvc'
- name: Upload binary
uses: actions/upload-artifact@v3
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
name: lanquetta-${{ matrix.target }}
path: target/release/lanquetta-${{ matrix.target }}.tar.gz
retention-days: 3
- name: Upload binary
uses: actions/upload-artifact@v3
if: matrix.target == 'x86_64-pc-windows-msvc'
with:
name: lanquetta-${{ matrix.target }}
path: target/release/lanquetta-${{ matrix.target }}.zip
retention-days: 3
release:
name: Release
runs-on: ubuntu-22.04
needs: build
permissions: write-all
steps:
- name: Download Linux binary
uses: actions/download-artifact@v3
with:
name: lanquetta-x86_64-unknown-linux-gnu
- name: Download Windows binary
uses: actions/download-artifact@v3
with:
name: lanquetta-x86_64-pc-windows-msvc
- run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes lanquetta-x86_64-unknown-linux-gnu.tar.gz lanquetta-x86_64-pc-windows-msvc.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}