Create a new release #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create a new release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseTag: | |
description: 'Release Tag' | |
required: true | |
productionRelease: | |
type: boolean | |
description: Mark release as production ready | |
jobs: | |
release-ubuntu: | |
name: Build for Linux | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
BUILD_TARGET: x86_64-unknown-linux-musl | |
BINARY_NAME: vercel-cache-helper | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build-musl | |
uses: gmiam/rust-musl-action@9e6a37bf27ecfffb6b92240ea276bea5487fa15d | |
continue-on-error: false | |
with: | |
args: cargo build --target $BUILD_TARGET --release | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: linux_musl_x86_64 | |
path: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}* | |
create-release: | |
name: Create github tag and release | |
runs-on: ubuntu-latest | |
needs: [release-ubuntu] | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/download-artifact@v2 | |
with: | |
name: linux_musl_x86_64 | |
path: ~/download/linux_musl | |
- name: Rename assets | |
run: | | |
mv ~/download/linux_musl/vercel-cache-helper ~/download/linux_musl/vercel-cache-helper_linux_musl_x86_64 | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "~/download/linux_musl/vercel-cache-helper_linux_musl_x86_64" | |
generateReleaseNotes: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.event.inputs.releaseTag }} | |
prerelease: ${{ github.event.inputs.productionRelease && github.event.inputs.productionRelease == 'false' }} |