Skip to content

Merge pull request #266 from kohbis/fix-github-release #2

Merge pull request #266 from kohbis/fix-github-release

Merge pull request #266 from kohbis/fix-github-release #2

---
name: GitHub release binary
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
jobs:
github-release:
name: GitHub release (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
rust: [stable]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Set toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Cargo build
run: >
cargo build
--release
--target ${{ matrix.target }}
- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
strip rslack
tar czvf rslack-${{ matrix.artifact_prefix }}.tar.gz rslack
shasum -a 256 rslack-${{ matrix.artifact_prefix }}.tar.gz > rslack-${{ matrix.artifact_prefix }}.sha256
- name: Releasing assets
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/rslack-${{ matrix.artifact_prefix }}.tar.gz
target/${{ matrix.target }}/release/rslack-${{ matrix.artifact_prefix }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}