Skip to content

Instantly share code, notes, and snippets.

@oeN
Created May 5, 2020 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oeN/6cba7c610c2e2c892f6c013f576e0c41 to your computer and use it in GitHub Desktop.
Save oeN/6cba7c610c2e2c892f6c013f576e0c41 to your computer and use it in GitHub Desktop.
godot - build and release on itch.io
# This is a basic workflow to help you get started with Actions
name: Build and release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Godot
uses: firebelley/godot-export@v1.2.0
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.2.1/mono/Godot_v3.2.1-stable_mono_linux_headless_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.2.1/mono/Godot_v3.2.1-stable_mono_export_templates.tpz
godot_template_version: 3.2.1.stable.mono
relative_project_path: ./godot_project
create_release: 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload builds as artifacts
uses: actions/upload-artifact@v2-preview
with:
name: builds
path: ./godot_project/exports/*.zip
release:
needs: build
runs-on: ubuntu-latest
name: Create the release
steps:
- uses: actions/checkout@v1
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@master"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.semvers.outputs.v_patch }}
release_name: ${{ steps.semvers.outputs.v_patch }}
body: ${{ steps.semvers.outputs.v_patch }} # FIXME: retrieve the commit history from the last tag
draft: false
prerelease: false
- shell: bash
name: save text information
run: |
mkdir -p release_info
echo ${{ steps.create_release.outputs.upload_url }} > release_info/upload-url.txt
echo ${{ steps.semvers.outputs.patch }} > release_info/current-version.txt
- name: Upload release-upload-url as artifact
uses: actions/upload-artifact@v2-preview
with:
name: release_info
path: release_info/*
upload-itch:
needs: build
runs-on: ubuntu-latest
name: Upload on itch.io
strategy:
matrix:
platform: [linux, windows, osx]
fail-fast: true
steps:
- name: Download builds
uses: actions/download-artifact@v1
with:
name: builds
- name: Download release_info
uses: actions/download-artifact@v1
with:
name: release_info
- name: Retrieve release info
id: release_info
run: |
value=`cat release_info/current-version.txt`
echo $value
echo "::set-output name=current_version::$value"
- name: upload
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: ${{ matrix.platform }}
ITCH_GAME: AWESOME-GAME
ITCH_USER: ITCH-USERNAME
PACKAGE: builds/${{ matrix.platform }}.zip
VERSION: ${{ steps.release_info.outputs.current_version }}
name: 'Delete old artifacts'
on:
schedule:
- cron: '0 2 * * *' # every hour
jobs:
delete-artifacts:
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment