-
Notifications
You must be signed in to change notification settings - Fork 30
95 lines (75 loc) · 2.78 KB
/
macos.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
name: macOS
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
macos-arm:
name: martypc (arm)
runs-on: macos-14
steps:
- name: Install nightly Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --default-host aarch64-apple-darwin --default-toolchain nightly --profile complete
. "$HOME/.cargo/env"
$HOME/.cargo/bin/cargo version
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cargo build
run: cargo +nightly build --profile release-lto --features use_winit,use_wgpu,sound,opl
- name: Copy files into install dir
run: cp LICENSE README.md CHANGELOG.md CREDITS.md target/release-lto/martypc install
- name: Rename install directory
run: mv install martypc
- name: Create artifact directory
run: mkdir artifacts
# GitHub zips all artifacts, losing file permissions.
# We'll need to tar the directory in order to
# preserve the file permissions
- name: Create artifact from install directory
run: tar cvf artifacts/martypc.tar martypc
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: 'martypc-${{ github.job }}-gha${{ github.run_number }}'
path: artifacts/martypc.tar
macos-x86:
name: martypc (x86)
runs-on: macos-13
steps:
- name: Install nightly Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --default-host x86_64-apple-darwin --default-toolchain nightly --profile complete
. "$HOME/.cargo/env"
$HOME/.cargo/bin/cargo version
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cargo build
run: cargo +nightly build --profile release-lto --features use_winit,use_wgpu,sound,opl
- name: Copy files into install dir
run: cp LICENSE README.md CHANGELOG.md CREDITS.md target/release-lto/martypc install
- name: Rename install directory
run: mv install martypc
- name: Create artifact directory
run: mkdir artifacts
# GitHub zips all artifacts, losing file permissions.
# We'll need to tar the directory in order to
# preserve the file permissions
- name: Create artifact from install directory
run: tar cvf artifacts/martypc.tar martypc
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: 'martypc-${{ github.job }}-gha${{ github.run_number }}'
path: artifacts/martypc.tar