Automatic Release #7
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: Automatic Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number for the release' | |
required: true | |
default: '1.0.0' | |
jobs: | |
create-love: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install zip utility | |
run: sudo apt-get install zip -y | |
- name: Create .love file | |
run: | | |
zip -r game.love * | |
mv game.love ${GITHUB_REPOSITORY#*/}-$(date +%Y%m%d%H%M%S).love | |
- name: Upload .love file as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: .LOVE file | |
path: | | |
*.love | |
convert-love: | |
runs-on: ubuntu-latest | |
needs: create-love | |
steps: | |
- name: Download .love file from previous job | |
uses: actions/download-artifact@v3 | |
with: | |
name: .LOVE file | |
path: . | |
- name: Install zip utility | |
run: sudo apt-get install zip -y | |
- name: Download LOVE.exe | |
run: | | |
mkdir love | |
cd love | |
curl -L -o love-win.zip https://github.com/love2d/love/releases/download/11.5/love-11.5-win64.zip | |
unzip love-win.zip | |
mv love-11.5-win64/* . | |
cd .. | |
- name: Create .exe file | |
run: | | |
cp love/love.exe game.exe | |
cat ${GITHUB_REPOSITORY#*/}-*.love >> game.exe | |
cp love/*.dll . | |
- name: Upload .exe file as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Game Build | |
path: | | |
game.exe | |
*.dll | |
build-and-release: | |
runs-on: ubuntu-latest | |
needs: [create-love, convert-love] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: Game Build | |
path: ./release-artifacts | |
- name: Zip Game Build | |
run: | | |
cd ./release-artifacts | |
zip -r ../GameBuild-${{ github.event.inputs.version }}.zip * | |
cd .. | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
tag_name: v${{ github.event.inputs.version }} | |
release_name: Release ${{ github.event.inputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./GameBuild-${{ github.event.inputs.version }}.zip | |
asset_name: GameBuild-${{ github.event.inputs.version }}.zip | |
asset_content_type: application/zip |