-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (100 loc) · 4.03 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Upload Release Assets
on:
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
release-linux:
name: Upload Release Assets
runs-on: ubuntu-24.04
env:
BEVY_ASSET_PATH: "/project/kodecks-bevy/assets"
strategy:
matrix:
toolchain: [x86_64-unknown-linux-gnu]
steps:
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install cross
run: cargo binstall cross --force -y
- name: Download assets
run: ./scripts/download.sh
- name: Build project
run: cross build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }}
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-${{ matrix.toolchain }}.tar.xz kodecks
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-server-${{ matrix.toolchain }}.tar.xz kodecks-server
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} --generate-notes --draft
continue-on-error: true
- name: Upload archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} *.tar.*
release-macos:
name: Upload Release Assets (macOS)
runs-on: macos-latest
env:
BEVY_ASSET_PATH: ${{ github.workspace }}/kodecks-bevy/assets
strategy:
matrix:
toolchain: [aarch64-apple-darwin]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Download assets
run: ./scripts/download.sh
- name: Build project
run: cargo build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }}
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-${{ matrix.toolchain }}.tar.xz kodecks
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-server-${{ matrix.toolchain }}.tar.xz kodecks-server
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} --generate-notes --draft
continue-on-error: true
- name: Upload archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} *.tar.*
release-windows:
name: Upload Release Assets (Windows)
runs-on: windows-latest
env:
BEVY_ASSET_PATH: ${{ github.workspace }}/kodecks-bevy/assets
strategy:
matrix:
toolchain: [x86_64-pc-windows-msvc]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Download assets
run: scripts/download.ps1
- name: Build project
run: cargo build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }}
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -acf kodecks-${{ matrix.toolchain }}.zip kodecks.exe
- name: Make archive
run: tar -C target/${{ matrix.toolchain }}/distribution -acf kodecks-server-${{ matrix.toolchain }}.zip kodecks-server.exe
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} --generate-notes --draft
continue-on-error: true
- name: Upload archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} kodecks-${{ matrix.toolchain }}.zip kodecks-server-${{ matrix.toolchain }}.zip