Skip to content

v0.7.0

v0.7.0 #9

on:
workflow_dispatch:
release:
types: [published]
name: build-and-release
jobs:
build-and-release:
strategy:
fail-fast: false
matrix:
include:
# x86_64-linux-gnu
- arch-name: x86_64-linux-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cross: false
file-ext:
# x86_64-linux-musl
- arch-name: x86_64-linux-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
cross: true
file-ext:
# x86_64-windows-msvc
- arch-name: x86_64-windows-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
cross: false
file-ext: .exe
# x86_64-windows-gnu
- arch-name: x86_64-windows-gnu
os: ubuntu-latest
target: x86_64-pc-windows-gnu
cross: true
file-ext: .exe
# x86_64-macos
- arch-name: x86_64-macos
os: macos-latest
target: x86_64-apple-darwin
cross: false
file-ext:
# aarch64-linux-gnu
- arch-name: aarch64-linux-gnu
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
cross: true
file-ext:
# aarch64-linux-musl
- arch-name: aarch64-linux-musl
os: ubuntu-latest
target: aarch64-unknown-linux-musl
cross: true
file-ext:
# aarch64-macos
- arch-name: aarch64-macos
os: macos-latest
target: aarch64-apple-darwin
cross: true
file-ext:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the latest tag
id: tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --target ${{ matrix.target }}
- name: Move binaries
run: |
mkdir artifacts/
mv target/${{ matrix.target }}/release/cargo-info${{ matrix.file-ext }} artifacts/cargo-info-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }}
- name: Calculate SHA256
run: |
cd artifacts/
openssl dgst -sha256 -r cargo-info-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }} > cargo-info-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }}.sha256sum
- name: Release binaries
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/*"
tag: ${{ steps.tag.outputs.tag }}
name: ${{ steps.tag.outputs.tag }}
allowUpdates: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}