Skip to content

cargo-msrv 0.17.1

cargo-msrv 0.17.1 #46

name: "ci-build-release-binaries"
on:
release:
types: [created]
jobs:
build_binaries:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tgz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
archive_ext: tgz
- target: x86_64-apple-darwin
os: macos-13
archive_ext: tgz
- target: aarch64-apple-darwin
os: macos-latest
archive_ext: tgz
- target: x86_64-pc-windows-msvc
os: windows-latest
archive_ext: zip
runs-on: ${{ matrix.os }}
steps:
- name: checkout_tagged_commit
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: set_output
id: set_output
shell: bash
run: |
echo "archive=cargo-msrv-${{ matrix.target }}-${{ github.event.release.tag_name }}.${{ matrix.archive_ext }}" >> $GITHUB_OUTPUT
echo "subfolder=cargo-msrv-${{ matrix.target }}-${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
- name: show_outputs
shell: bash
run: |
echo "Archive: '${{ steps.set_output.outputs.archive }}'"
echo "Subfolder: '${{ steps.set_output.outputs.subfolder }}'"
- name: create_pkg_subfolder
shell: bash
run: mkdir ${{ steps.set_output.outputs.subfolder }}
- name: copy_files_to_pkg_subfolder
shell: bash
run: |
cp LICENSE-APACHE ${{ steps.set_output.outputs.subfolder }}
cp LICENSE-MIT ${{ steps.set_output.outputs.subfolder }}
cp README.md ${{ steps.set_output.outputs.subfolder }}
- name: install_rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: install musl-gcc
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl-tools # provides musl-gcc
version: 1.0
- name: build_${{ matrix.target }}_release_binary
shell: bash
run: cargo build --target=${{ matrix.target }} --release
- name: install_cargo_about
shell: bash
run: cargo install --locked cargo-about
- name: generate_dep_licenses_file
shell: bash
run: cargo about generate --output-file "${{ steps.set_output.outputs.subfolder }}/third-party-licenses.html" about.hbs
- name: pack_archive_macos
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest'
shell: bash
run: |
cp ./target/${{ matrix.target }}/release/cargo-msrv ${{ steps.set_output.outputs.subfolder }}
gtar --create --gzip --file=${{ steps.set_output.outputs.archive }} ${{ steps.set_output.outputs.subfolder }}
- name: pack_archive_linux
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
cp target/${{ matrix.target }}/release/cargo-msrv ${{ steps.set_output.outputs.subfolder }}
tar --create --gzip --file=${{ steps.set_output.outputs.archive }} ${{ steps.set_output.outputs.subfolder }}
- name: pack_archive_windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
cp target/${{ matrix.target }}/release/cargo-msrv.exe ./${{ steps.set_output.outputs.subfolder }}
7z a -tzip ${{ steps.set_output.outputs.archive }} ${{ steps.set_output.outputs.subfolder }}
- name: upload_artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.set_output.outputs.archive }}
asset_name: ${{ steps.set_output.outputs.archive }}
asset_content_type: application/gzip