Skip to content

main menu updates

main menu updates #40

name: Publish Fishy to Itch.io
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} # Needs to be added through github
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}} # Needs to be added through github
GITHUB_TOKEN: ${{ secrets.TOKEN }}
IS_MAIN: ${{ contains(github.ref, 'main') }}
PROJECT_NAME: "Fishy"
jobs:
CleanArtifacts:
# This job clears out the previous artifacts made so you don't run out of space in your github account
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.TOKEN }}
expire-in: 1hr
Export:
needs: CleanArtifacts # wait for artifacts to clean before making a new one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Download + Authorize Godot
run: |
curl -L -o godot.zip https://downloads.tuxfamily.org/godotengine/4.1.3/Godot_v4.1.3-stable_linux.x86_64.zip
unzip godot.zip
mv Godot_v4.1.3-stable_linux.x86_64 godot
ls
chmod +x godot
- name: Download Export Templates
run: |
curl -L -o export_templates.zip https://downloads.tuxfamily.org/godotengine/4.1.3/Godot_v4.1.3-stable_export_templates.tpz
unzip export_templates.zip
- name: Install Export Templates
run: |
mkdir -p ~/.local/share/godot/export_templates/4.1.3.stable
mv ./templates/* ~/.local/share/godot/export_templates/4.1.3.stable
- name: Export Web
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "Web" ./exports/index.html
- name: Export Linux/X11
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "Linux/X11" ./exports/fishy.x86_64
- name: Export Windows Desktop
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "Windows Desktop" ./exports/fishy.exe
- name: Export macOS
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "macOS" ./exports/fishy.zip
- uses: actions/upload-artifact@v2
with:
name: exports
path: exports
Release:
needs: Export
if: ${{ contains(github.ref, 'main') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Version
id: tag_version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{ secrets.TOKEN }}
- name: Verify Tag
if: ${{ !steps.tag_version.outputs.new_tag }}
run: exit 1
- name: Download Exports
uses: actions/download-artifact@v2
with:
name: exports
path: exports
- name: Zip
run: zip -r release-${{ steps.tag_version.outputs.new_tag }}.zip exports
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Upload Release Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-${{ steps.tag_version.outputs.new_tag }}.zip
asset_name: release-${{ steps.tag_version.outputs.new_tag }}.zip
asset_content_type: application/zip
- uses: frdrwrt/write-to-file@v1.3
with:
filepath: ./VERSION.txt
content: ${{ steps.tag_version.outputs.new_version }}
mode: 0655
- uses: actions/upload-artifact@v2
with:
name: VERSION
path: ./VERSION.txt
Publish:
needs: Release
if: ${{ contains(github.ref, 'main') }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- name: Download + Authorize Butler
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- name: Login To Butler
run: ./butler login
- name: Push Web to Itch
run: ./butler push ./exports itchy-nogal/fishy:web --userversion-file ./VERSION/VERSION.txt
- name: Push Linux/X11 to Itch
run: ./butler push ./exports itchy-nogal/fishy:linux --userversion-file ./VERSION/VERSION.txt
- name: Push Windows Desktop to Itch
run: ./butler push ./exports itchy-nogal/fishy:win --userversion-file ./VERSION/VERSION.txt
- name: Push macOS to Itch
run: ./butler push ./exports itchy-nogal/fishy:mac --userversion-file ./VERSION/VERSION.txt
Cleanup:
needs: [Export, Release, Publish]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v1
with:
name: VERSION