-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (138 loc) · 4.86 KB
/
stable-matrix-commander.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: matrix-commander stable build
on:
push:
branches: [ trigger/stable ]
workflow_dispatch:
env:
index: https://github.com/cargo-prebuilt/index/releases/download/stable-index/
crate: matrix-commander
version: 0.3.0
dl: https://static.crates.io/crates/matrix-commander/matrix-commander-0.3.0.crate
checksum: 8d4e58622f7866aef060e3698d0a41699fc5d39492a8a80637c831bc2a442f76
git: https://github.com/8go/matrix-commander-rs
bins: matrix-commander-rs
file: ./crates/matrix-commander.toml
CARGO_TERM_COLOR: always
python-version: "3.12"
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
id: cache
with:
path: |
build
key: ${{ env.crate }}-${{ env.version }}-stable-crate
enableCrossOsArchive: true
- name: Create Folder
if: ${{ !steps.cache.outputs.cache-hit }}
run: mkdir -p ./build
- name: Download crate and check hash
if: ${{ !steps.cache.outputs.cache-hit }}
run: |
wget ${{ env.dl }}
echo "${{ env.checksum }} ${{ env.crate }}-${{ env.version }}.crate" | sha256sum -c
tar -xf ${{ env.crate }}-${{ env.version }}.crate
mv ${{ env.crate }}-${{ env.version }}/* ./build
- name: Update Rust
if: ${{ !steps.cache.outputs.cache-hit }}
run: |
rustup update
rustc --version
- name: Generated lockfile if needed
if: ${{ !steps.cache.outputs.cache-hit }}
working-directory: ./build
run: test -f Cargo.lock || cargo +stable generate-lockfile --verbose
t1-aarch64-apple-darwin:
strategy:
fail-fast: false
matrix:
target: [ x86_64-apple-darwin, aarch64-apple-darwin ]
runs-on: macos-14
needs: [ setup ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Get crate from cache
uses: actions/cache@v4
with:
path: |
build
key: ${{ env.crate }}-${{ env.version }}-stable-crate
enableCrossOsArchive: true
fail-on-cache-miss: true
# - uses: Swatinem/rust-cache@v2
# if: ${{ !false }}
# with:
# workspaces: "./build -> target"
# prefix-key: "v0-rust-${{ matrix.target }}-${{ env.crate }}-${{ env.version }}"
- name: Update Rust and Add Target
run: |
rustup update
rustc --version
rustup target add ${{ matrix.target }}
- uses: cargo-prebuilt/cargo-prebuilt-action@v3
with:
pkgs: cargo-auditable
- name: Build crate
working-directory: ./build
run: cargo +stable auditable build --verbose --release --locked --target ${{ matrix.target }} --features 'reqwest/native-tls-vendored'
- name: Collect
run: python ./scripts/collect.py ${{ matrix.target }} ./build/target/${{ matrix.target }}/release ${{ env.bins }}
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.target }}-macos14
path: |
${{ matrix.target }}.tar.gz
${{ matrix.target }}.hashes.json
# t1-apple-darwin:
# strategy:
# fail-fast: false
# matrix:
# target: [ x86_64-apple-darwin, aarch64-apple-darwin ]
# runs-on: macos-latest
# needs: [ setup ]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ env.python-version }}
# - name: Get crate from cache
# uses: actions/cache@v4
# with:
# path: |
# build
# key: ${{ env.crate }}-${{ env.version }}-stable-crate
# enableCrossOsArchive: true
# fail-on-cache-miss: true
## - uses: Swatinem/rust-cache@v2
## if: ${{ !false }}
## with:
## workspaces: "./build -> target"
## prefix-key: "v0-rust-${{ matrix.target }}-${{ env.crate }}-${{ env.version }}"
# - name: Update Rust and Add Target
# run: |
# rustup update
# rustc --version
# rustup target add ${{ matrix.target }}
# - uses: cargo-prebuilt/cargo-prebuilt-action@v3
# with:
# pkgs: cargo-auditable
# - name: Build crate
# working-directory: ./build
# run: cargo +stable auditable build --verbose --release --locked --target ${{ matrix.target }} --features 'reqwest/native-tls-vendored'
# - name: Collect
# run: python ./scripts/collect.py ${{ matrix.target }} ./build/target/${{ matrix.target }}/release ${{ env.bins }}
# - name: Artifact
# uses: actions/upload-artifact@v4
# with:
# name: target-${{ matrix.target }}
# path: |
# ${{ matrix.target }}.tar.gz
# ${{ matrix.target }}.hashes.json