Repository navigation
91 lines (85 loc) · 2.67 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (85 loc) · 2.67 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
88
89
90
91
name: release
on:
push:
tags: ["v*"]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-release:
name: build-release (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
archive: motionframe-linux-x86_64.tar.gz
binary: target/release/motionframe
- name: windows-x86_64
os: windows-latest
archive: motionframe-windows-x86_64.zip
binary: target/release/motionframe.exe
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
- uses: Swatinem/rust-cache@v2
- if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwayland-dev libxkbcommon-dev
- run: cargo build -p motionframe-desktop --release
- name: Stage package
shell: bash
run: |
mkdir -p package
cp "${{ matrix.binary }}" package/
cp README.md LICENSE THIRD-PARTY-LICENSES.md package/
- name: Create archive
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
powershell -NoProfile -Command "Compress-Archive -Path package/* -DestinationPath '${{ matrix.archive }}'"
else
tar -czf "${{ matrix.archive }}" -C package .
fi
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: ${{ matrix.archive }}
if-no-files-found: error
build-macos:
name: build-macos (universal)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
- name: Build universal .app and .dmg
run: bash scripts/package-macos.sh
- uses: actions/upload-artifact@v4
with:
name: motionframe-macos-universal.dmg
path: motionframe-macos-universal.dmg
if-no-files-found: error
github-release:
runs-on: ubuntu-latest
needs: [build-release, build-macos]
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="${GITHUB_REF_NAME:-manual-${GITHUB_RUN_NUMBER}}"
gh release create "$tag" artifacts/**/* --repo "$GITHUB_REPOSITORY" \
--draft --title "$tag" --notes "MotionFrame Rust release."