Skip to content
Open
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
name: CI

env:
CROSS_VER: '0.2.5'
CROSS_VER: "0.2.5"
CARGO_NET_RETRY: 3

permissions:
Expand All @@ -21,8 +21,10 @@ jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
# action pin via: git ls-remote https://github.com/actions/checkout refs/tags/v5.0.0 | head -1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
Expand All @@ -37,6 +39,7 @@ jobs:
custom-checks:
name: Custom checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand Down Expand Up @@ -93,7 +96,7 @@ jobs:
fi

main:
needs: [ fmt, custom-checks ]
needs: [fmt, custom-checks]
name: ${{ matrix.target_name }} (check, clippy)
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -140,14 +143,17 @@ jobs:
persist-credentials: false

- name: Setup Rust Cache
# action pin via: git ls-remote https://github.com/Swatinem/rust-cache refs/tags/v2.8.1 | head -1
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
with:
prefix-key: ${{ matrix.target }}

- name: Setup cross
- name: Install cross
if: matrix.use_cross == true
run: |
curl -fL --retry 3 "https://github.com/cross-rs/cross/releases/download/v${CROSS_VER}/cross-x86_64-unknown-linux-musl.tar.gz" | tar vxz -C /usr/local/bin
# action pin via: git ls-remote https://github.com/taiki-e/install-action refs/tags/v2.60.0 | head -1
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: cross@${{ env.CROSS_VER }}

- name: Run cargo/cross check
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/create_release_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish release files for CD native and non-cd-native environments

on:
repository_dispatch:
types: [ release-created ]
types: [release-created]

permissions:
# Write permissions to call the repository dispatch
Expand All @@ -28,8 +28,9 @@ jobs:
# Use the Ubuntu 22.04 image to link with a low version of glibc
#
# https://github.com/topgrade-rs/topgrade/issues/1095
platform: [ ubuntu-22.04, macos-latest, macos-15-intel, windows-latest ]
platform: [ubuntu-22.04, macos-latest, macos-15-intel, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 90
env:
tag: ${{ github.event.client_payload.tag }}
steps:
Expand Down Expand Up @@ -165,6 +166,7 @@ jobs:
# Even though this is cross-compiled, it links to the libc6-<arch>-cross installed on the host
# (see the apt-get install calls below)
runs-on: ubuntu-22.04
timeout-minutes: 120
env:
matrix_target: ${{ matrix.target }}
tag: ${{ github.event.client_payload.tag }}
Expand Down Expand Up @@ -276,10 +278,8 @@ jobs:
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' }}
shell: bash


- name: Upload assets
run:
gh release upload "${tag}" assets/*
run: gh release upload "${tag}" assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -290,7 +290,7 @@ jobs:

triggers:
runs-on: ubuntu-latest
needs: [ native_build, cross_build ]
needs: [native_build, cross_build]
env:
tag: ${{ github.event.client_payload.tag }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_to_homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
homebrew-publish:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Bump formulae
uses: dawidd6/action-homebrew-bump-formula@3428a0601bba3173ec0bdcc945be23fa27aa4c31 # v5
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ name: Update PyPi

on:
repository_dispatch:
types: [ release-created ]
types: [release-created]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# TODO: make linux/windows/macos/sdist a matrix. See how other workflows do it.
linux:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
target: [x86_64, x86, aarch64]
Expand All @@ -33,6 +38,7 @@ jobs:

windows:
runs-on: windows-latest
timeout-minutes: 60
strategy:
matrix:
target: [x64, x86]
Expand All @@ -54,6 +60,7 @@ jobs:

macos:
runs-on: macos-latest
timeout-minutes: 60
strategy:
matrix:
target: [x86_64, aarch64]
Expand All @@ -75,6 +82,7 @@ jobs:

sdist:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand Down Expand Up @@ -108,7 +116,7 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: 'wheels-*/*'
subject-path: "wheels-*/*"

- name: Publish to PyPI
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_to_winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: vedantmgoyal2009/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f # main
with:
Expand Down