Automatic Release #5
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: | |
build-and-release: | |
runs-on: ubuntu-latest | |
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: Create Release | |
id: create_release | |
if: steps.check_files.outputs.files_exists == 'true' | |
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 | |
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_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 |