Publish #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: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'The version to release. A matching tag prefixed with "v" MUST exist' | |
required: true | |
type: string | |
itch_release: | |
description: Release to itch | |
default: true | |
type: boolean | |
github_release: | |
description: Release to GitHub | |
default: true | |
type: boolean | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: v${{ inputs.version_number }} | |
path: project | |
- name: "Prepare Ren'Py cache" | |
id: cache-renpy | |
uses: actions/cache@v3 | |
with: | |
path: renpy | |
key: ${{ runner.os }}-renpy | |
- name: "Download Ren'Py" | |
if: steps.cache-renpy.outputs.cache-hit != 'true' | |
run: mkdir renpy && curl https://www.renpy.org/dl/8.0.2/renpy-8.0.2-sdk.tar.bz2 | tar -xjC renpy --strip-components 1 | |
- name: Build distribution | |
run: ./renpy/renpy.sh "" distribute project --package mac --package win --package linux --destination target | |
- name: Get changelog information | |
run: awk -e '/^## /{a+=1} {if(a==1)print$0}' project/CHANGELOG.md >release.md | |
- run: printf '\n## Checksums\n\nChecksum | File\n:--- | :---\n' >>release.md | |
- name: Generate checksum information | |
run: md5sum * | sed -Ee 's_^([^\s]+)\s+_\1 \| _g' >>../release.md | |
working-directory: target | |
- name: Show current information | |
run: ls target; cat release.md | |
- name: Push to itch.io | |
uses: Ayowel/[email protected] | |
if: inputs.itch_release | |
with: | |
butler_key: ${{ secrets.BUTLER_CREDENTIALS }} | |
itch_game: colors | |
itch_user: kiminako | |
files: target/* | |
version: ${{ inputs.version_number }} | |
- name: Create GitHub release | |
uses: softprops/[email protected] | |
if: inputs.github_release | |
with: | |
name: Release v${{ inputs.version_number }} | |
tag_name: v${{ inputs.version_number }} | |
body_path: release.md | |
fail_on_unmatched_files: true | |
files: target/* |