Skip to content

[cargo](deps): Bump the deps group across 1 directory with 86 updates #252

[cargo](deps): Bump the deps group across 1 directory with 86 updates

[cargo](deps): Bump the deps group across 1 directory with 86 updates #252

Workflow file for this run

name: Build Binaries
on:
push:
branches:
- main
pull_request:
# Run whenever the PR is pushed to, receives a label, or is created with
# one or more labels:
types: [synchronize, labeled]
release:
types: [published]
# Prevent the workflow from running multiple jobs at once when a PR is created
# with multiple labels, but do allow multiple jobs if multiple merges and/or
# releases are made in quick succession:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-13
os-name: macos
architecture: arm64
suffix: ""
use-cross: true
- target: x86_64-apple-darwin
os: macos-13
os-name: macos
architecture: x86_64
suffix: ""
use-cross: false
- target: x86_64-pc-windows-msvc
os: windows-2019
os-name: windows
architecture: x86_64
suffix: ".exe"
use-cross: false
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
os-name: linux
architecture: x86_64
suffix: ""
use-cross: false
if: >
github.event_name != 'pull_request'
|| contains(github.event.pull_request.labels.*.name, 'buildme')
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Activate cache
uses: Swatinem/rust-cache@v2
- name: Install cross
if: matrix.use-cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Build
if: "!matrix.use-cross"
run: cargo build --release --target ${{ matrix.target }} --verbose
- name: Build w/cross
if: matrix.use-cross
run: cross build --release --target ${{ matrix.target }} --verbose
- name: Prepare artifact
run: |
mkdir "$asset_name"
mv "$target_path" "$asset_name"
cp README.md LICENSE CHANGELOG.md "$asset_name"
env:
target_path: target/${{ matrix.target }}/release/s3invsync${{ matrix.suffix }}
asset_name: s3invsync-${{ matrix.target }}
- name: Zip artifact (Unix)
if: "!startsWith(matrix.os, 'windows')"
run: zip -r "$asset_name".zip "$asset_name"
env:
asset_name: s3invsync-${{ matrix.target }}
- name: Zip artifact (Windows)
if: "startsWith(matrix.os, 'windows')"
run: Compress-Archive -Path s3invsync-${{ matrix.target }}/* -Destination s3invsync-${{ matrix.target }}.zip
shell: powershell
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: s3invsync-${{ matrix.target }}.zip
path: s3invsync-${{ matrix.target }}.zip
- name: Upload release asset
if: github.event_name == 'release'
run: gh release upload "$tag" "$asset_name".zip
env:
tag: ${{ github.event.release.tag_name }}
asset_name: s3invsync-${{ matrix.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}