From e3c68db2b13386ab629defd210946aa21a83463d Mon Sep 17 00:00:00 2001 From: Christopher Miller Date: Tue, 7 May 2024 21:55:41 -0400 Subject: [PATCH] Build workflow --- .github/workflows/build.yml | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7020fd4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +name: Build Game + +on: + push: + tags: + - *.*.* + +env: + CARGO_TERM_COLOR: always + ITCH_USERNAME: alumux + ITCH_GAME_ID: quatrix + +jobs: + build-windows: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + lfs: true + - name: Install required packages + run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev libxcb-xfixes0-dev libxcb-shape0-dev cmake mingw-w64 zip + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install Windows Target + run: rustup target add x86_64-pc-windows-gnu + - name: Get Version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Setup Cache + uses: Swatinem/rust-cache@v1 + - name: Build Windows Game + env: + VERSION: ${{ steps.get_version.outputs.VERSION }} + run: ./install_windows_client.sh + - name: Publish to Itch.io + uses: KikimoraGames/itch-publish@v0.0.3 + with: + butlerApiKey: ${{ secrets.BUTLER_API_KEY }} + gameData: windows + itchUsername: ${{ env.ITCH_USERNAME }} + itchGameId: ${{ env.ITCH_GAME_ID }} + buildNumber: ${{ steps.get_version.outputs.VERSION }} + buildChannel: windows + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + lfs: true + - name: Install required packages + run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev libxcb-xfixes0-dev libxcb-shape0-dev cmake mingw-w64 zip + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.77 + override: true + - name: Get Version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Setup Cache + uses: Swatinem/rust-cache@v1 + - name: Build Linux Game + env: + VERSION: ${{ steps.get_version.outputs.VERSION }} + run: ./install_linux_client.sh + - name: Publish to Itch.io + uses: KikimoraGames/itch-publish@v0.0.3 + with: + butlerApiKey: ${{ secrets.BUTLER_API_KEY }} + gameData: linux + itchUsername: ${{ env.ITCH_USERNAME }} + itchGameId: ${{ env.ITCH_GAME_ID }} + buildNumber: ${{ steps.get_version.outputs.VERSION }} + buildChannel: linux