Skip to content

Publish crate cargo-xwin 0.16.4 from #1470 #12

Publish crate cargo-xwin 0.16.4 from #1470

Publish crate cargo-xwin 0.16.4 from #1470 #12

name: cargo-xwin stable build
on:
push:
branches: [ trigger/stable ]
workflow_dispatch:
env:
index: https://github.com/cargo-prebuilt/index/releases/download/stable-index/
crate: cargo-xwin
version: 0.16.4
dl: https://static.crates.io/crates/cargo-xwin/cargo-xwin-0.16.4.crate
checksum: 5e6c3dd7f20fdd197397532ac882e918cfe1d56f262a97ded7460a50e031e06b
git: https://github.com/rust-cross/cargo-xwin
bins: cargo-xwin
file: ./crates/cargo-xwin.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 }}
- 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 }}
# - 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