Skip to content

Commit

Permalink
work?!?!??!
Browse files Browse the repository at this point in the history
  • Loading branch information
29cmb committed Jul 29, 2024
1 parent 0e01f4e commit 377a004
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-love-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

steps:
- name: Download .love file from previous job
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: .LOVE file
path: .
Expand Down
93 changes: 66 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/trigger-workflow-and-wait@v1.6.1
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 }}
Expand All @@ -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

0 comments on commit 377a004

Please sign in to comment.