Skip to content

wireman: Bump to v0.2 #7

wireman: Bump to v0.2

wireman: Bump to v0.2 #7

Workflow file for this run

name: CD
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
publish-github:
name: Publish for ${{ matrix.os }} (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: linux
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- build: linux
os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
- build: linux
os: ubuntu-22.04
target: i686-unknown-linux-gnu
- build: windows-gnu
os: windows-2022
target: x86_64-pc-windows-msvc
- build: macos
os: macos-14
target: x86_64-apple-darwin
- build: macos
os: macos-14
target: aarch64-apple-darwin
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set the release version
shell: bash
run: echo "VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.os != 'windows-2022' }}
command: build
args: --release --locked --target ${{ matrix.target }}
- name: Prepare release assets
shell: bash
run: |
dirname="wireman-${{ env.VERSION }}-${{ matrix.target }}"
mkdir -p "$dirname"
cp {LICENSE.md,README.md,CHANGELOG.md} "$dirname"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv "target/${{ matrix.target }}/release/wireman.exe" "$dirname"
else
mv "target/${{ matrix.target }}/release/wireman" "$dirname"
fi
echo "dirname=$dirname" >> $GITHUB_ENV
- name: Create release artifacts
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "${{ env.dirname }}.zip" "${{ env.dirname }}"
else
tar -czvf "${{ env.dirname }}.tar.gz" "${{ env.dirname }}"
fi
- name: Upload the binary releases
uses: svenstaro/upload-release-action@v2
with:
file: wireman-${{ env.VERSION }}-${{ matrix.target }}*
file_glob: true
overwrite: true
tag: ${{ github.ref }}
release_name: "Release v${{ env.VERSION }}"
repo_token: ${{ secrets.GITHUB_TOKEN }}