-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (75 loc) · 2.5 KB
/
build.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
name: Build and Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: '3.3.0'
jobs:
build:
permissions:
contents: write
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Xcode to support visionOS
run: |
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
xcodebuild -showsdks
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ github.event.inputs.version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build Rust
if: steps.cache-primes.outputs.cache-hit != 'true'
run: |
git clone https://github.com/rust-lang/rust.git -b beta
cd rust
git apply ../patch/rust/01-tvos_arm64e_support.patch
./x check
./x build --stage 2
rustup toolchain link stage0 build/host/stage0-sysroot
rustup toolchain link stage1 build/host/stage1
rustup toolchain link stage2 build/host/stage2
rustc +stage2 -vV
which rustc
- name: Build cargo-c
if: steps.cache-primes.outputs.cache-hit != 'true'
run: |
git clone https://github.com/lu-zero/cargo-c.git
cd cargo-c
git apply ../patch/cargo-c/01-add-visionos-support.patch
cargo install --path .
- name: Build
run: |
rustc +stage2 -vV
which rustc
rustc +stage2 --print target-list|grep vision
rustc +stage2 --print target-list|grep tvos
make build version=${{ github.event.inputs.version }}
- name: Push Package.swift
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
add: |
- Package.swift
message: "chore: bump version to ${{ github.event.inputs.version }}"
push: "origin HEAD:${{ github.ref_name }}"
- name: Upload binary to GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.event.inputs.version }}
tag_name: ${{ github.event.inputs.version }}
files: |
./dist/release/*.txt
./dist/release/*.zip
prerelease: ${{ contains(github.event.inputs.version, 'alpha') || contains(github.event.inputs.version, 'beta') }}
fail_on_unmatched_files: true