Skip to content

feat: Enhance progress tracking with additional progress bar #96

feat: Enhance progress tracking with additional progress bar

feat: Enhance progress tracking with additional progress bar #96

Workflow file for this run

name: Build
on:
pull_request:
push:
branches: [main]
jobs:
metadata:
name: Check if version changed
runs-on: ubuntu-latest
outputs:
optimize-build: ${{ github.event_name == 'push' }}
release: ${{ github.event_name == 'push' && github.repository == 'conda-incubator/conda-mirror' && steps.version-metadata.outputs.changed == 'true' }}
version: ${{ steps.version-metadata.outputs.newVersion }}
steps:
- name: Checkout source code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: Quantco/ui-actions/version-metadata@cd71d2a0e30b25569f6d723e57acca83347e58fc # v1.0.18
id: version-metadata
with:
file: ./Cargo.toml
token: ${{ secrets.GITHUB_TOKEN }}
version-extraction-override: 'regex:version = "(.*)"'
build:
name: Build Binary (${{ matrix.target }})
runs-on: ${{ matrix.os }}
needs: [metadata]
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
# - target: aarch64-unknown-linux-musl
# os: ubuntu-24.04-arm
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-24.04-arm
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-11-arm
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-13
steps:
- name: Checkout source code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Setup musl
if: endsWith(matrix.target, '-musl')
run: |
sudo apt-get install musl-tools
- name: Rust cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
with:
key: build-${{ matrix.target }}-${{ needs.metadata.outputs.optimize-build }}-${{ matrix.os }}
- name: Build
run: |
cargo build --locked --profile ${{ needs.metadata.outputs.optimize-build && 'release-min-size' || 'release' }} --color always --target ${{ matrix.target }}${{ endsWith(matrix.target, '-musl') && ' --no-default-features --features rustls-tls' || '' }}
mv target/${{ matrix.target }}/${{ needs.metadata.outputs.optimize-build && 'release-min-size' || 'release' }}/conda-mirror${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }} conda-mirror-${{ matrix.target }}${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }}
- name: Upload Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: conda-mirror-${{ matrix.target }}
path: conda-mirror-${{ matrix.target }}${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }}
if-no-files-found: error
release:
name: Create Release
needs: [metadata, build]
if: needs.metadata.outputs.release == 'true'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Download artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: conda-mirror-*
merge-multiple: true
- name: Push v${{ needs.metadata.outputs.version }} tag
run: |
git tag v${{ needs.metadata.outputs.version }}
git push origin v${{ needs.metadata.outputs.version }}
- name: Create Release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
with:
generate_release_notes: true
tag_name: v${{ needs.metadata.outputs.version }}
draft: true
files: conda-mirror-*