Change gh cli login approach #5
Workflow file for this run
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: Binary release | |
# Manual release with input version number | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Enter the release version (e.g., 0.1.0) | |
required: true | |
push: | |
branches: | |
- binary-release | |
jobs: | |
# This job builds the common webapp HTML/JS/CSS used for all platforms | |
build-webapp: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build web application/upload artifact | |
uses: ./.github/actions/build-web | |
# This job builds the binaries for each release | |
build-binary: | |
needs: build-webapp | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
artifact_name: linux-artifact | |
artifact_filename: stump_server | |
- os: windows-latest | |
artifact_name: windows-artifact | |
artifact_filename: stump_server.exe | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build stump server | |
uses: ./.github/actions/build-server | |
- name: Upload server artifact | |
uses: ./.github/actions/upload-artifact | |
with: | |
upload-name: ${{ matrix.artifact_name }} | |
upload-path: target/release/${{ matrix.artifact_filename }} | |
# This job creates the release and organizes associated files | |
create-release: | |
needs: build-binary | |
runs-on: ubuntu-latest | |
permissions: write-all | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download artifact (Linux) | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux-artifact | |
path: StumpServer-linux | |
- name: Download artifact (Windows) | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows-artifact | |
path: StumpServer-windows | |
- name: Install dependencies | |
run: sudo apt-get install -y gh zip | |
- name: Zip artifacts | |
run: | | |
cd StumpServer-linux | |
zip -r ../linux-build-results.zip * | |
cd ../StumpServer-windows | |
zip -r ../windows-build-results.zip * | |
cd .. | |
- name: Create release and upload artifacts | |
run: | | |
gh release create v${{ github.event.inputs.version || '0.0.test' }} \ | |
--draft \ | |
--target binary-release \ | |
--title 'Release ${{ github.event.inputs.version || '0.0.test' }}' \ | |
--generate-notes \ | |
linux-build-results.zip#StumpServer-${{ github.event.inputs.version || '0.0.test' }}-x64-Linux.zip \ | |
windows-build-results.zip#StumpServer-${{ github.event.inputs.version || '0.0.test' }}-x64-Windows.zip |