generated from emilk/eframe_template
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.94 KB
/
ci-build.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
# Origin config by @Kilerd
name: Build Canary Version
on:
push:
tags:
- v*
jobs:
release:
name: Release on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [linux_glibc-x86_64, windows-x86_64]
include:
- platform: linux_glibc-x86_64
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
bin: doukutsu-save-editor
- platform: windows-x86_64
target: x86_64-pc-windows-msvc
os: windows-latest
bin: doukutsu-save-editor.exe
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
toolchain: stable
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libgtk-3-dev libatk-bridge2.0-dev
- uses: Swatinem/rust-cache@v2
- name: Build executable
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare assets
shell: bash
run: |
mv target/${{ matrix.target }}/release/${{ matrix.bin }} .
tar -cvzf ${{ matrix.target }}.tar.gz LICENSE ${{ matrix.bin }}
- name: Declare some variables # https://stackoverflow.com/a/61699863
id: vars
shell: bash
run: |
editor_ver=$(cargo metadata --format-version 1 --no-deps | sed -r 's/.*"version":"([^"]*)".*/\1/')
echo "editor_ver=${editor_ver}" >> $GITHUB_OUTPUT
- name: Pre-Release
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.target }}.tar.gz
tag_name: v${{ steps.vars.outputs.editor_ver }}
prerelease: false