Skip to content

removing prefix v on version #3

removing prefix v on version

removing prefix v on version #3

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
env:
bin_name: kubectl-rsh
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- build: linux-gnu
target: x86_64-unknown-linux-gnu
- build: linux-musl
target: x86_64-unknown-linux-musl
steps:
- name: Ubuntu Setup
if: matrix.build == 'linux-musl'
run: |
sudo apt update
sudo apt install -y --no-install-recommends musl-tools
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Sources Checkout
uses: actions/checkout@v2
- name: Set Version in Cargo.toml
run: |
sed -i 's/version = "0.1.0" ###/version = "${{ github.ref_name }}"/g' Cargo.toml
- name: Build Release
run: cargo build --release --target ${{ matrix.target }}
- name: Set "archive" Env Variable
run: echo "archive=$(echo ${{ env.bin_name }}_${{ github.ref_name }}_${{ matrix.target }}.tar.gz)" >> "$GITHUB_ENV"
- name: Create Archive and SHASUM
run: |
mv ./target/${{ matrix.target }}/release/${{ env.bin_name }} .
tar -czf ./${{ env.archive }} ${{ env.bin_name }} LICENSE
sha256sum ${{ env.archive }} > ${{ env.archive }}.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.archive }}
path: ./${{ env.archive }}*
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Tree
run: tree
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: '**/kubectl-rsh_*.tar.gz*'