Skip to content

chore: release master (#647) #78

chore: release master (#647)

chore: release master (#647) #78

on:
push:
branches:
- master
name: release-please
jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.SKIM_RS_BOT_APP_ID }}
private-key: ${{ secrets.SKIM_RS_BOT_PRIVATE_KEY }}
- id: release-please
uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
outputs:
release_created: ${{ steps.release-please.outputs.releases_created }}
tag_name: ${{ steps.release-please.outputs.skim--tag_name }}
setup-release:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
steps:
- run: |
echo '${{ needs.release-please.outputs.release_created }}'
outputs:
tag_name: ${{ needs.release-please.outputs.tag_name }}
publish-crate:
runs-on: ubuntu-latest
needs: setup-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install correct toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Publish to crates.io
run: cargo publish -p skim
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
build-binaries:
needs: setup-release
name: Build release binaries
permissions:
contents: write
strategy:
matrix:
arch:
- x86_64
- aarch64
- arm
- armv7
os:
- unknown-linux-musl
- apple-darwin
exclude:
- arch: arm
os: apple-darwin
- arch: armv7
os: apple-darwin
runs-on: ${{ contains(matrix.os, 'apple') && 'macos' || 'ubuntu' }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}
args: "--release --locked"
- name: Create archive
env:
BIN_NAME: "sk"
ARCHIVE_NAME: "skim-${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}.tgz"
run: |
tar -C target/*/release/ -czvf "$ARCHIVE_NAME" "$BIN_NAME"
- name: Upload binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.setup-release.outputs.tag_name }}
ARCHIVE_NAME: "skim-${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}.tgz"
run: |
gh release upload "$TAG" "$ARCHIVE_NAME"