Skip to content

feat: add git-current-branch #12

feat: add git-current-branch

feat: add git-current-branch #12

Workflow file for this run

name: cargo build
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
name: cargo build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: git-utils-${{ github.ref_name }}-linux-amd64.tar.gz
- os: macos-latest
asset_name: git-utils-${{ github.ref_name }}-darwin-amd64.tar.gz
- os: windows-latest
asset_name: git-utils-${{ github.ref_name }}-windows-amd64.zip
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
tar -czvf target/release/${{ matrix.asset_name }} \
target/release/git-default-branch
if: matrix.os != 'windows-latest'
- name: Build (windows)
run: |
cargo +nightly install anonlink
anonlink
cargo +nightly build --verbose --release
Compress-Archive -Path target/release/git-*.exe -Destination ${{ matrix.asset_name }}
if: matrix.os == 'windows-latest'
- name: Publish binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true