Skip to content

ci: fix main tester #240

ci: fix main tester

ci: fix main tester #240

Workflow file for this run

name: Prepare New Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
release:
description: 'Release version type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
pull-requests: read
jobs:
GUT:
runs-on: ubuntu-latest
name: Unit & Integration Tests
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Check out personal godot-tester repository
# uses: actions/checkout@v3
# with:
# repository: db0/godot-tester
# path: ./.github/actions/godot-tester
# Runs a single command using the runners shell
- name: ⚙ Run Tests
uses: croconut/godot-tester@v5
with:
version: 3.5
# should be long enough for asset import files to get generated
import-time: 300
assert-check: true
# Allowing some fails on push, as sometimes randomly some asserts might false negative and I haven't yet located the precice reason for this inconsistency
max-fails: 5
# How long the test should be run before it's timed out and fails
test-timeout: 3600
# Directory containing Gut tests
direct-scene: tests/cli/tests.tscn
custom-godot-dl-url: "https://github.com/godotengine/godot/releases/download/3.6-stable/Godot_v3.6-stable_linux_headless.64.zip"
custom-godot-binary-path: "Godot_v3.6-stable_linux_headless.64"
version_and_release:
runs-on: ubuntu-latest
name: Export Game
needs: ["GUT"]
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "📣 New Release"
id: release
uses: rymndhng/release-on-push-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: ${{ github.event_name == 'push' && 'norelease' || inputs.release }}
use_github_release_notes: true
# Always include the checkout step so that
# your project is available for Godot to export
- name: "✏️ Generate release changelog"
if: ${{ steps.release.outputs.version != '' }}
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "💾 Commit new version"
if: ${{ steps.release.outputs.version != '' }}
run: |
sed -i 's/GAME_VERSION := ".*"/GAME_VERSION := "${{ steps.release.outputs.version }}"/g' ./src/dreamscape/CFConst.gd
sed -i 's/Therapy through Nightmares \[.*\]/Therapy through Nightmares [${{ steps.release.outputs.version }}]/g' README.md
git config user.email github-actions@github.com
git config user.name github-actions
git commit -am 'version incremented'
git push
- name: "🛠 Randomize which html music will be exported"
if: ${{ steps.release.outputs.version != '' }}
shell: bash
run: |
SCENE=ordeal; KEEP=6; cd assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=journal; KEEP=4; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=main; KEEP=2; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=shop; KEEP=2; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=boss; KEEP=4; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
- name: "🤖 Export game"
if: ${{ steps.release.outputs.version != '' }}
uses: firebelley/godot-export@v6.0.0
with:
godot_executable_download_url: https://github.com/godotengine/godot/releases/download/3.6-stable/Godot_v3.6-stable_linux_headless.64.zip
godot_export_templates_download_url: https://github.com/godotengine/godot/releases/download/3.6-stable/Godot_v3.6-stable_export_templates.tpz
relative_project_path: ./
base_version: "${{ steps.release.outputs.version }}"
create_release: false
archive_export_output: true
export_debug: true
- name: "🛠 Prepare files for publishing"
if: ${{ steps.release.outputs.version != '' }}
shell: bash
run: |
cp -v /home/runner/.local/share/godot/dist/* .
mkdir -p build/StandaloneWindows64
mkdir -p build/StandaloneLinux64
mkdir -p build/StandaloneMacOS
cp '/home/runner/.local/share/godot/builds/LinuxX11/Hypnagonia_Linux.x86_64' .
cp '/home/runner/.local/share/godot/builds/LinuxX11/Hypnagonia_Linux.x86_64' build/StandaloneLinux64/
cp '/home/runner/.local/share/godot/builds/LinuxX11 Lite/Hypnagonia_Linux_Lite.x86_64' .
cp '/home/runner/.local/share/godot/builds/Windows Desktop/Hypnagonia_Windows.exe' .
cp '/home/runner/.local/share/godot/builds/Windows Desktop/Hypnagonia_Windows.exe' build/StandaloneWindows64/
cp '/home/runner/.local/share/godot/builds/Windows Desktop Lite/Hypnagonia_Windows_Lite.exe' .
cp '/home/runner/.local/share/godot/builds/Mac OSX/Hypnagonia_MacOSX.zip' .
cp '/home/runner/.local/share/godot/builds/Mac OSX/Hypnagonia_MacOSX.zip' build/StandaloneMacOS/
ls -larth
- name: "🚀 Upload HTML5 version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: HTML5
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: HTML5.zip
VERSION: "${{ steps.release.outputs.version }}"
- name: "☢ Upload Windows Lite version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: windows_lite
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Windows_Lite.exe
VERSION: "${{ steps.release.outputs.version }}"
- name: "☢ Upload Windows version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: windows
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Windows.exe
VERSION: "${{ steps.release.outputs.version }}"
- name: "🐧 Upload Linux Lite version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux_lite
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Linux_Lite.x86_64
VERSION: "${{ steps.release.outputs.version }}"
- name: "🐧 Upload Linux version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Linux.x86_64
VERSION: "${{ steps.release.outputs.version }}"
- name: "☣ Upload OSX version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: osx
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_MacOSX.zip
VERSION: "${{ steps.release.outputs.version }}"
- name: "🔧 Publish all versions with Steamworks"
if: ${{ steps.release.outputs.version != '' }}
uses: game-ci/steam-deploy@v1
with:
username: ${{ secrets.STEAM_USERNAME }}
password: ${{ secrets.STEAM_PASSWORD }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: 1962610
buildDescription: "${{ steps.release.outputs.version }}"
rootPath: build
depot1Path: StandaloneWindows64
depot2Path: StandaloneLinux64
depot3Path: StandaloneMacOS
releaseBranch: prerelease
- name: 📨 Notify Matrix General Chat
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_TOKEN }}
message: "New Release Available: [${{ steps.release.outputs.version }}](https://github.com/db0/hypnagonia/blob/main/CHANGELOG.md)"
server: "matrix.org"
if: ${{ steps.release.outputs.version != '' }}