name: Release
permissions:
contents: write
on:
push:
tags:
- v*
env:
CARGO_TERM_COLOR: always
jobs:
publish:
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
protoc: linux-x86_64
steps:
- uses: actions/checkout@v4
- run: |
cd $(mktemp -d)
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protoc-26.0-${{ matrix.job.protoc }}.zip
unzip protoc-26.0-${{ matrix.job.protoc }}.zip
sudo mv bin/protoc /usr/local/bin/
- name: Publish crate
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release:
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
protoc: linux-x86_64
gcc: gcc-x86-64-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
protoc: linux-x86_64
gcc: gcc-aarch64-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
protoc: osx-x86_64
- os: macos-latest
target: aarch64-apple-darwin
protoc: osx-x86_64
steps:
- uses: actions/checkout@v4
- run: |
cd $(mktemp -d)
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protoc-26.0-${{ matrix.job.protoc }}.zip
unzip protoc-26.0-${{ matrix.job.protoc }}.zip
sudo mv bin/protoc /usr/local/bin/
- run: rustup target add ${{ matrix.job.target }}
- run: sudo apt-get install -y ${{ matrix.job.gcc }}
if: ${{ matrix.job.os == 'ubuntu-latest' }}
- name: Build
run: |
cargo build --release --target ${{ matrix.job.target }}
mv target/${{ matrix.job.target }}/release/stablessh stablessh-${{ matrix.job.target }}
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: stablessh-${{ matrix.job.target }}