Skip to content

feat: add publish to workflow #4

feat: add publish to workflow

feat: add publish to workflow #4

Workflow file for this run

name: cargo build
on:
push:
tags:
- '*'
jobs:
build:
name: cargo build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
- name: Install Rust (rustup)
run: |
rustup update stable
rustup default stable
if: matrix.os != 'macos-latest'
- name: Install Rust (macos)
run: |
curl https://sh.rustup.rs | sh -s -- -y
echo "{:$HOME/.cargo/bin}" >> $GITHUB_PATH
if: matrix.os == 'macos-latest'
- name: Build
run:
cargo build --verbose --release
strip target/release/git-default-branch
- name: Publish binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/git-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true