-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,40 +9,86 @@ on: | |
default: '1.0.0' | ||
|
||
jobs: | ||
create-love: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- 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@v2 | ||
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@v2 | ||
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: Run "Create .love file and build to .exe" workflow | ||
uses: convictional/[email protected] | ||
with: | ||
owner: ${{ github.repository_owner }} | ||
repo: ${{ github.event.repository.name }} | ||
github_token: ${{ secrets.PAT }} | ||
workflow_file_name: build-love-file.yml | ||
wait_interval: 10 | ||
trigger_workflow: true | ||
wait_workflow: true | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
continue-on-error: true | ||
with: | ||
name: Game Build | ||
path: ./release-artifacts | ||
|
||
- name: Check if artifact was downloaded | ||
id: check_files | ||
uses: andstor/file-existence-action@v2 | ||
with: | ||
files: "./release-artifacts/Game Build.zip" | ||
- name: Zip Game Build | ||
run: | | ||
cd ./release-artifacts | ||
zip -r ../GameBuild-${{ github.event.inputs.version }}.zip * | ||
cd .. | ||
- name: Create Release | ||
id: create_release | ||
if: steps.check_files.outputs.files_exists == 'true' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
|
@@ -53,18 +99,11 @@ jobs: | |
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
if: steps.check_files.outputs.files_exists == 'true' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./release-artifacts/Game Build.zip | ||
asset_path: ./GameBuild-${{ github.event.inputs.version }}.zip | ||
asset_name: GameBuild-${{ github.event.inputs.version }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Notify about missing artifact | ||
if: steps.check_files.outputs.files_exists == 'false' | ||
run: | | ||
echo "The Game Build artifact was not found. Please check the 'Create .love file and build to .exe' workflow." | ||
exit 1 | ||
asset_content_type: application/zip |