This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
80 lines (72 loc) · 2.37 KB
/
release-native.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
name: Release Native
on:
push:
tags: ["v*"]
env:
RELEASE_NAME: bevy_shell
jobs:
release:
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: x86_64-unknown-linux-gnu.tar.gz
- target: x86_64-apple-darwin
os: macos-latest
name: x86_64-apple-darwin.tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
name: x86_64-pc-windows-msvc.zip
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
target: ${{ matrix.target }}
- name: Setup | Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt install libasound2-dev libudev-dev pkg-config
- name: Build
run: |
cd launchers/native
cargo build --release --target ${{ matrix.target }}
- name: Post Build | Prepare artifacts [Windows]
if: matrix.os == 'windows-latest'
run: |
cd launchers/native
7z a ../../${{ matrix.name }} static/
cd -
cd target/${{ matrix.target }}/release
mv native-launcher.exe ${{ env.RELEASE_NAME }}.exe
7z a ../../../${{ matrix.name }} ${{ env.RELEASE_NAME }}.exe
cd -
7z a ${{ matrix.name }} assets/
mv ${{ matrix.name }} ${{ env.RELEASE_NAME }}-${{ matrix.name }}
- name: Post Build | Prepare artifacts [-nix]
if: matrix.os != 'windows-latest'
run: |
cd launchers/native
mv static/ ../../
cd -
cd target/${{ matrix.target }}/release
mv native-launcher ../../../${{ env.RELEASE_NAME }}
cd -
tar cvzf ${{ matrix.name }} assets/ static/ ${{ env.RELEASE_NAME }}
mv ${{ matrix.name }} ${{ env.RELEASE_NAME }}-${{ matrix.name }}
- name: Release | Upload
uses: softprops/action-gh-release@v1
with:
files: ${{ env.RELEASE_NAME }}-${{ matrix.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}