Repository navigation
87 lines (74 loc) · 2.55 KB
/
Copy pathrelease.yml
File metadata and controls
87 lines (74 loc) · 2.55 KB
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
name: Build and Release Nox
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
name: Build for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: nox-linux-amd64
- os: ubuntu-latest
target: aarch64-linux-android
artifact_name: nox-android-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: nox-windows-amd64.msi
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: nox-macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: nox-macos-arm64
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross (for Android)
if: matrix.target == 'aarch64-linux-android'
run: cargo install cross
- name: Build with cross
if: matrix.target == 'aarch64-linux-android'
run: cross build --release --target ${{ matrix.target }} --package nox
- name: Build with cargo (Unix)
if: matrix.target != 'aarch64-linux-android' && runner.os != 'Windows'
run: cargo build --release --target ${{ matrix.target }} --package nox
- name: Install cargo-wix (Windows)
if: runner.os == 'Windows'
run: cargo install cargo-wix
- name: Initialize and Build MSI (Windows)
if: runner.os == 'Windows'
run: |
cargo wix init --package nox
cargo wix --no-build --target ${{ matrix.target }} --package nox --output target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Rename Artifact (Unix)
if: runner.os != 'Windows'
run: mv target/${{ matrix.target }}/release/nox target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}