Skip to content

v0.4.2

v0.4.2 #24

Workflow file for this run

name: Release
on:
release:
types:
- created
jobs:
build:
strategy:
matrix:
environment:
- os: "ubuntu-latest"
target: "x86_64-unknown-linux-gnu"
cross: true
exec: jwtinfo
artifact-name: "jwtinfo-unix64"
- os: "macos-latest"
target: "x86_64-apple-darwin"
cross: true
exec: jwtinfo
artifact-name: "jwtinfo-macos"
- os: "macos-latest"
target: "aarch64-apple-darwin"
cross: true
exec: jwtinfo
artifact-name: "jwtinfo-macos-silicon"
- os: "ubuntu-latest"
target: "x86_64-pc-windows-gnu"
cross: true
exec: jwtinfo.exe
artifact-name: "jwtinfo-win64.exe"
packages: "gcc-mingw-w64"
- os: "ubuntu-latest"
target: "armv7-unknown-linux-gnueabihf"
cross: true
exec: jwtinfo
artifact-name: "jwtinfo-armv7"
packages: "gcc-arm-linux-gnueabihf"
runs-on: "${{ matrix.environment.os }}"
name: "${{ matrix.environment.os }} (${{ matrix.environment.target }})"
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.environment.target }}
override: true
- name: Install system packages
if: matrix.environment.packages
run: |
sudo apt-get update;
sudo apt-get install -qq ${{ matrix.environment.packages }};
- uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.environment.cross }}
command: build
args: --release --target ${{ matrix.environment.target }} --verbose
- name: Make release executable
run: chmod +x target/${{ matrix.environment.target }}/release/${{ matrix.environment.exec }}
- name: Gzip artifact
run: gzip -f --keep target/${{ matrix.environment.target }}/release/${{ matrix.environment.exec }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/${{ matrix.environment.target }}/release/${{ matrix.environment.exec }}.gz
asset_name: ${{ matrix.environment.artifact-name }}.gz
asset_content_type: application/x-gzip
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release on Crates.io
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
cargo publish