Manual Release #26
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: Manual Release | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
version: { required: true, description: "The version number" } | |
jobs: | |
changelog: | |
name: Generate changelog | |
runs-on: ubuntu-latest | |
outputs: | |
release_body: ${{ steps.git-cliff.outputs.content }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v2 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: --latest --strip header | |
publish-binaries: | |
name: Publish binaries | |
needs: changelog | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
TARGET: [x86_64-linux] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set the release version | |
run: | | |
echo ::set-output name=version::${{ github.event.inputs.version }} | |
- name: Install Zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: Show Zig version | |
run: | | |
zig version | |
zig env | |
- name: Build | |
run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.TARGET }} | |
- name: Prepare release assets | |
shell: bash | |
run: | | |
mkdir -p release/scripts | |
cp zig-out/bin/void-pilot release/ | |
cp -r zig-out/bin/scripts/* release/scripts/ | |
mv release/ void-pilot/ | |
- name: Create release artifacts | |
shell: bash | |
run: | | |
tar -czvf void-pilot-${{ matrix.TARGET }}.tar.gz \ | |
void-pilot/ | |
- name: Upload the binary releases | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.event.inputs.version }} | |
name: Release v${{ github.event.inputs.version }} | |
body: ${{ needs.changelog.outputs.release_body }} | |
append_body: false | |
files: | | |
./void-pilot-${{ matrix.TARGET }}.tar.gz | |
./install.sh | |
prerelease: false | |
env: | |
version: ${{ github.event.inputs.version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |