Skip to content

Publish crate matrix-commander 0.3.0 from #1472 #16

Publish crate matrix-commander 0.3.0 from #1472

Publish crate matrix-commander 0.3.0 from #1472 #16

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