CI Changes

This commit is contained in:
Minnie A. Trethewey (Mike)
2023-02-15 22:44:38 -08:00
committed by aerinon
parent 54858500e5
commit ca40f87daa
38 changed files with 2062 additions and 589 deletions

View File

@@ -0,0 +1,51 @@
name: Prepare AppVersion
description: Prepare AppVersion document for later use
runs:
using: "composite"
steps:
# checkout commit
- name: Checkout commit
shell: bash
run: |
echo "Checkout commit"
- name: Checkout commit
uses: actions/checkout@v4.1.4
# Set Run Number
- name: Set Run Number
shell: bash
run: |
echo "Set Run Number"
- name: Set Run Number
id: set_run_number
shell: bash
run: |
GITHUB_RUN_NUMBER="${{ github.run_number }}a${{ github.run_attempt }}"
echo "github_run_number=$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
# Prepare AppVersion
#TODO: source/classes/appversion.py writes the tag format
- name: 💬Prepare AppVersion
shell: bash
run: |
echo "💬Prepare AppVersion"
- name: Prepare AppVersion
shell: bash
env:
OS_NAME: ${{ inputs.os-name }}
GITHUB_RUN_NUMBER: ${{ steps.set_run_number.outputs.github_run_number }}
run: |
python -m source.classes.appversion
python ./resources/ci/common/prepare_appversion.py
# upload appversion artifact for later step
- name: 🔼Upload AppVersion Artifact
shell: bash
run: |
echo "🔼Upload AppVersion Artifact"
- name: 🔼Upload AppVersion Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: appversion
path: ./resources/app/meta/manifests/app_version.txt

88
.github/actions/build/action.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Build
description: Build app
inputs:
calling-job:
required: true
description: Job that's calling this one
os-name:
required: true
description: OS to run on
python-version:
required: true
description: Python version to install
runs:
using: "composite"
steps:
# checkout commit
- name: Checkout commit
shell: bash
run: |
echo "Checkout commit"
- name: Checkout commit
uses: actions/checkout@v4.1.4
# get parent dir
- name: Get Parent Directory
id: parentDir
uses: ./.github/actions/get-parent-dir
# try to get UPX
- name: Get UPX
shell: bash
run: |
echo "Get UPX"
- name: Get UPX
shell: bash
env:
OS_NAME: ${{ inputs.os-name }}
UPX_VERSION: "4.2.3"
run: |
python ./resources/ci/common/get_upx.py
# run build.py
- name: 💬Build Binaries
shell: bash
run: |
echo "💬Build Binaries"
- name: Build Binaries
shell: bash
run: |
pip install pyinstaller
python -m source.meta.build
# upload problem children
# - name: 🔼Upload Problem Children Artifact
# shell: bash
# run: |
# echo "🔼Upload Problem Children Artifact"
# - name: 🔼Upload Problem Children Artifact
# uses: actions/upload-artifact@v4.3.3
# with:
# name: problemchildren-${{ inputs.os-name }}-py${{ inputs.python-version }}
# path: ./resources/app/meta/manifests/excluded_dlls.json
# if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`
# prepare binary artifact for later step
- name: 💬Prepare Binary Artifact
shell: bash
run: |
echo "💬Prepare Binary Artifact"
- name: Prepare Binary Artifact
shell: bash
env:
OS_NAME: ${{ inputs.os-name }}
run: |
python ./resources/ci/common/prepare_binary.py
# upload binary artifact for later step
- name: 🔼Upload Binary Artifact
shell: bash
run: |
echo "🔼Upload Binary Artifact"
- name: 🔼Upload Binary Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: binary-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ${{ steps.parentDir.outputs.parentDir }}/artifact
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

View File

@@ -0,0 +1,41 @@
name: 📁Get Parent Directory
description: Get Parent Directory
outputs:
parentDirNotWin:
description: "Parent Directory (!Windows)"
value: ${{ steps.parentDirNotWin.outputs.value }}
parentDir:
description: "Parent Directory (Windows)"
value: ${{ steps.parentDir.outputs.value }}
#########
# actions
#########
# mad9000/actions-find-and-replace-string@5
runs:
using: "composite"
steps:
# get parent directory
- name: Get Repo Name
uses: mad9000/actions-find-and-replace-string@5
id: repoName
with:
source: ${{ github.repository }}
find: "${{ github.repository_owner }}/"
replace: ""
- name: 📁Get Parent Directory Path (!Windows)
uses: mad9000/actions-find-and-replace-string@5
id: parentDirNotWin
with:
source: ${{ github.workspace }}
find: "${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}"
replace: ${{ steps.repoName.outputs.value }}
- name: 📁Get Parent Directory Path (Windows)
uses: mad9000/actions-find-and-replace-string@5
id: parentDir
with:
source: ${{ steps.parentDirNotWin.outputs.value }}
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}

49
.github/actions/install/action.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: 💿Install
description: Install app
inputs:
calling-job:
required: true
description: Job that's calling this one
os-name:
required: true
description: OS to run on
python-version:
required: true
description: Python version to install
#########
# actions
#########
# actions/checkout@v4.1.4
# actions/setup-python@v5.1.0
# actions/upload-artifact@v4.3.3
runs:
using: "composite"
steps:
# install python
- name: 💿Install Python
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ inputs.python-version }}
# install modules via pip
- name: 💿Install Modules
shell: bash
env:
OS_NAME: ${{ inputs.os-name }}
run: |
echo "Install Modules"
python ./resources/ci/common/get_pipline.py
# print pipline
- name: PipLine
shell: bash
run: |
echo "PipLine"
cat ./resources/user/meta/manifests/pipline.txt
# upload pipline
- name: 🔼Upload PipLine
uses: actions/upload-artifact@v4.3.3
with:
name: pipline-${{ inputs.calling-job }}-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ./resources/user/meta/manifests
if: contains(inputs.calling-job, 'test')

View File

@@ -0,0 +1,77 @@
name: 📀->📦Prepare Release
description: Prepare Release for Deployment
inputs:
os-name:
required: true
description: OS to run on
python-version:
required: true
description: Python version to install
#########
# actions
#########
# Artheau/SpriteSomething/get-parent-dir
# actions/checkout@v4.1.4
# actions/download-artifact@v4.1.7
runs:
using: "composite"
steps:
# checkout commit
- name: Checkout commit
shell: bash
run: |
echo "✔Checkout commit"
- name: Checkout commit
uses: actions/checkout@v4.1.4
# get parent dir
- name: 📁Get Parent Directory
shell: bash
run: |
echo "📁Get Parent Directory"
- name: 📁Get Parent Directory
id: parentDir
uses: ./.github/actions/get-parent-dir
# download binary artifact
- name: 🔽Download Binary Artifact
shell: bash
run: |
echo "🔽Download Binary Artifact"
- name: 🔽Download Binary Artifact
uses: actions/download-artifact@v4.1.7
with:
name: binary-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ./
# download appversion artifact
- name: 🔽Download AppVersion Artifact
uses: actions/download-artifact@v4.1.7
with:
name: appversion
path: ${{ steps.parentDir.outputs.parentDir }}/build
# Prepare Release
- name: 💬Prepare Release
shell: bash
run: |
echo "💬Prepare Release"
- name: Prepare Release
shell: bash
env:
OS_NAME: ${{ inputs.os-name }}
run: |
python ./resources/ci/common/prepare_release.py
# upload archive artifact for later step
- name: 🔼Upload Archive Artifact
shell: bash
run: |
echo "🔼Upload Archive Artifact"
- name: 🔼Upload Archive Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: archive-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ${{ steps.parentDir.outputs.parentDir }}/deploy

76
.github/actions/tag-repo/action.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: 🏷Tag Repository
description: Tag a repository
inputs:
repository:
description: "Repository Owner/Name; octocat/Hello-World"
required: true
ref-name:
description: "Reference name; branch, tag, etc"
required: true
github-tag:
description: "Reference to tag with"
required: true
debug:
description: "Debug Mode, won't set tag"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: 🏷Tag Repository
uses: actions/github-script@v7.0.1
with:
github-token: ${{ env.FINE_PAT }}
script: |
const debug = ${{ inputs.debug }} == "true" || ${{ inputs.debug }} == true;
const repository = '${{ inputs.repository }}';
const owner = repository.substring(0,repository.indexOf('/'));
const repo = repository.substring(repository.indexOf('/')+1);
const ref = '${{ inputs.ref-name }}';
// get git tag
const gitTag = '${{ inputs.github-tag }}';
console.log('Repo Data: ', `${owner}/${repo}@${ref}`)
console.log('Git tag: ', gitTag)
if(gitTag == '') {
let msg = 'Result: 🔴No Git Tag sent, aborting!';
console.log(msg)
core.setFailed(msg)
return
}
// get latest commit
const latestCommit = await github.rest.git.getRef({
owner: owner,
repo: repo,
ref: ref
})
// get latest refs
const latestRefs = await github.rest.git.listMatchingRefs({
owner: owner,
repo: repo
})
let latestTag = ''; // bucket for latest tag
// get last tag in data
for(let thisRef of latestRefs.data) {
if(thisRef['ref'].indexOf('tags') > -1) {
let refParts = thisRef['ref'].split('/');
latestTag = refParts[-1];
}
}
console.log('Latest tag:', latestTag)
if(latestTag != gitTag) {
if(debug) {
console.log(`DEBUG: 🔵Creating '${gitTag}' tag`)
} else {
console.log(`Result: 🟢Creating '${gitTag}' tag`)
github.rest.git.createRef({
owner: owner,
repo: repo,
ref: `refs/tags/${gitTag}`,
sha: latestCommit.data.object.sha
})
}
} else {
console.log('Result: 🟡Not creating release tag')
}

97
.github/actions/test/action.yml vendored Normal file
View File

@@ -0,0 +1,97 @@
name: Test
description: Test app
inputs:
os-name:
required: true
description: OS to run on
python-version:
required: true
description: Python version to install
#########
# actions
#########
# actions/checkout@v4.1.4
# actions/download-artifact@v4.1.7
# actions/upload-artifact@v4.3.3
# coactions/setup-xvfb@v1.0.1
runs:
using: "composite"
steps:
# download pipline
- name: 🔽Download PipLine
shell: bash
run: |
echo "🔽Download PipLine"
- name: 🔽Download PipLine
uses: actions/download-artifact@v4.1.7
with:
name: pipline-test-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ./resources/user/meta/manifests
# run tests
- name: 🖥Test Base
shell: bash
run: |
echo "🖥Test Base"
- name: 🖥Test Base
shell: bash
run: |
mkdir -p ./failures
echo "" > ./failures/errors.txt
python -m pip install tqdm
python ./test/NewTestSuite.py
# - name: 🖥Test Mystery
# shell: bash
# run: |
# echo "🖥Test Mystery"
# if: contains(inputs.os-name, 'macos')
# - name: 🖥Test Mystery
# shell: bash
# run: |
# python ./test/MysteryTestSuite.py
# if: contains(inputs.os-name, 'macos')
# upload logs
- name: 🔼Upload Logs
shell: bash
run: |
echo "🔼Upload Logs"
- name: 🔼Upload Logs
uses: actions/upload-artifact@v4.3.3
with:
name: logs-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ./logs
if-no-files-found: ignore
# print failures
- name: 💬Print Failures
if: failure()
shell: bash
run: |
echo "💬Print Failures"
- name: Print Failures
if: failure()
shell: bash
run: |
ERR_STRING="$(cat ./failures/errors.txt)"
ERR_STRING="${ERR_STRING//'%'/'%25'}"
ERR_STRING="${ERR_STRING//$'\n'/' | '}"
ERR_STRING="${ERR_STRING//$'\r'/' | '}"
ERR_STRING="${ERR_STRING//$'\n'/'%0A'}"
ERR_STRING="${ERR_STRING//$'\r'/'%0D'}"
echo "::error ::$ERR_STRING"
# upload failures
- name: 🔼Upload Failures
if: failure()
shell: bash
run: |
echo "🔼Upload Failures"
- name: 🔼Upload Failures
if: failure()
uses: actions/upload-artifact@v4.3.3
with:
name: failures-${{ inputs.os-name }}-py${{ inputs.python-version }}
path: ./failures

View File

@@ -1,317 +0,0 @@
# workflow name
name: Build
# fire on
on:
push:
branches:
- DoorDev
- DoorDevUnstable
pull_request:
branches:
- DoorDev
# stuff to do
jobs:
# Install & Build
# Set up environment
# Build
# Run build-gui.py
# Run build-dr.py
install-build:
name: Install/Build
# cycle through os list
runs-on: ${{ matrix.os-name }}
# VM settings
# os & python versions
strategy:
matrix:
os-name: [ ubuntu-latest, ubuntu-20.04, windows-latest ]
python-version: [ 3.9 ]
# needs: [ install-test ]
steps:
# checkout commit
- name: Checkout commit
uses: actions/checkout@v3
# install python
- name: Install python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- run: |
python --version
# install dependencies via pip
- name: Install dependencies via pip
env:
OS_NAME: ${{ matrix.os-name }}
run: |
python ./resources/ci/common/install.py
pip install pyinstaller
# get parent directory
- name: Get Repo Name
uses: mad9000/actions-find-and-replace-string@3
id: repoName
with:
source: ${{ github.repository }}
find: '${{ github.repository_owner }}/'
replace: ''
- name: Get Parent Directory Path (!Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDirNotWin
with:
source: ${{ github.workspace }}
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
- name: Get Parent Directory Path (Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDir
with:
source: ${{ steps.parentDirNotWin.outputs.value }}
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
# try to get UPX
- name: Get UPX
env:
OS_NAME: ${{ matrix.os-name }}
run: |
python ./resources/ci/common/get_upx.py
# run build-gui.py
- name: Build GUI
run: |
python ./source/meta/build-gui.py
# run build-dr.py
- name: Build DungeonRandomizer
run: |
python ./source/meta/build-dr.py
# prepare binary artifacts for later step
- name: Prepare Binary Artifacts
env:
OS_NAME: ${{ matrix.os-name }}
run: |
python ./resources/ci/common/prepare_binary.py
# upload binary artifacts for later step
- name: Upload Binary Artifacts
uses: actions/upload-artifact@v3
with:
name: binaries-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.value }}/artifact
# Install & Preparing Release
# Set up environment
# Local Prepare Release action
install-prepare-release:
name: Install/Prepare Release
# cycle through os list
runs-on: ${{ matrix.os-name }}
# VM settings
# os & python versions
strategy:
matrix:
# install/release on not bionic
os-name: [ ubuntu-latest, ubuntu-20.04, windows-latest ]
python-version: [ 3.9 ]
needs: [ install-build ]
steps:
# checkout commit
- name: Checkout commit
uses: actions/checkout@v3
# install python
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- run: |
python --version
# install dependencies via pip
- name: Install Dependencies via pip
env:
OS_NAME: ${{ matrix.os-name }}
run: |
python ./resources/ci/common/install.py
# get parent directory
- name: Get Repo Name
uses: mad9000/actions-find-and-replace-string@3
id: repoName
with:
source: ${{ github.repository }}
find: '${{ github.repository_owner }}/'
replace: ''
- name: Get Parent Directory Path (!Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDirNotWin
with:
source: ${{ github.workspace }}
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
- name: Get Parent Directory Path (Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDir
with:
source: ${{ steps.parentDirNotWin.outputs.value }}
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
# download binary artifact
- name: Download Binary Artifact
uses: actions/download-artifact@v3
with:
name: binaries-${{ matrix.os-name }}
path: ./
# Prepare AppVersion & Release
- name: Prepare AppVersion & Release
env:
OS_NAME: ${{ matrix.os-name }}
run: |
python ./build-app_version.py
python ./resources/ci/common/prepare_appversion.py
python ./resources/ci/common/prepare_release.py
# upload appversion artifact for later step
- name: Upload AppVersion Artifact
uses: actions/upload-artifact@v3
with:
name: appversion-${{ matrix.os-name }}
path: ./resources/app/meta/manifests/app_version.txt
# upload archive artifact for later step
- name: Upload Archive Artifact
uses: actions/upload-artifact@v3
with:
name: archive-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.value }}/deploy
# Deploy to GitHub Releases
# Release Name: ALttPDoorRandomizer v${GITHUB_TAG}
# Release Body: Inline content of RELEASENOTES.md
# Release Body: Fallback to URL to RELEASENOTES.md
# Release Files: ${{ steps.parentDir.outputs.value }}/deploy
deploy-release:
name: Deploy GHReleases
runs-on: ${{ matrix.os-name }}
# VM settings
# os & python versions
strategy:
matrix:
# release only on focal
os-name: [ ubuntu-latest ]
python-version: [ 3.9 ]
needs: [ install-prepare-release ]
steps:
# checkout commit
- name: Checkout commit
uses: actions/checkout@v3
# get parent directory
- name: Get Repo Name
uses: mad9000/actions-find-and-replace-string@3
id: repoName
with:
source: ${{ github.repository }}
find: '${{ github.repository_owner }}/'
replace: ''
- name: Get Parent Directory Path (!Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDirNotWin
with:
source: ${{ github.workspace }}
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
- name: Get Parent Directory Path (Windows)
uses: mad9000/actions-find-and-replace-string@3
id: parentDir
with:
source: ${{ steps.parentDirNotWin.outputs.value }}
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
replace: ${{ steps.repoName.outputs.value }}
- name: Install Dependencies via pip
run: |
python -m pip install pytz requests
# download appversion artifact
- name: Download AppVersion Artifact
uses: actions/download-artifact@v3
with:
name: appversion-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.value }}/build
# download ubuntu archive artifact
- name: Download Ubuntu Archive Artifact
uses: actions/download-artifact@v3
with:
name: archive-ubuntu-latest
path: ${{ steps.parentDir.outputs.value }}/deploy/linux
# download macos archive artifact
# - name: Download MacOS Archive Artifact
# uses: actions/download-artifact@v3
# with:
# name: archive-macOS-latest
# path: ${{ steps.parentDir.outputs.value }}/deploy/macos
# download windows archive artifact
- name: Download Windows Archive Artifact
uses: actions/download-artifact@v3
with:
name: archive-windows-latest
path: ${{ steps.parentDir.outputs.value }}/deploy/windows
# debug info
- name: Debug Info
id: debug_info
# shell: bash
# git tag ${GITHUB_TAG}
# git push origin ${GITHUB_TAG}
run: |
GITHUB_TAG="$(head -n 1 ../build/app_version.txt)"
echo "::set-output name=github_tag::$GITHUB_TAG"
GITHUB_TAG="v${GITHUB_TAG}"
RELEASE_NAME="ALttPDoorRandomizer ${GITHUB_TAG}"
echo "Release Name: ${RELEASE_NAME}"
echo "Git Tag: ${GITHUB_TAG}"
# create a pre/release
- name: Create a Pre/Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.debug_info.outputs.github_tag }}
release_name: ALttPDoorRandomizer v${{ steps.debug_info.outputs.github_tag }}
body_path: RELEASENOTES.md
draft: true
prerelease: true
if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')
# upload linux archive asset
- name: Upload Linux Archive Asset
id: upload-linux-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../deploy/linux/ALttPDoorRandomizer.tar.gz
asset_name: ALttPDoorRandomizer-${{ steps.debug_info.outputs.github_tag }}-linux-focal.tar.gz
asset_content_type: application/gzip
if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')
# upload macos archive asset
# - name: Upload MacOS Archive Asset
# id: upload-macos-asset
# uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ../deploy/macos/ALttPDoorRandomizer.tar.gz
# asset_name: ALttPDoorRandomizer-${{ steps.debug_info.outputs.github_tag }}-osx.tar.gz
# asset_content_type: application/gzip
# if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')
# upload windows archive asset
- name: Upload Windows Archive Asset
id: upload-windows-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../deploy/windows/ALttPDoorRandomizer.zip
asset_name: ALttPDoorRandomizer-${{ steps.debug_info.outputs.github_tag }}-windows.zip
asset_content_type: application/zip
if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')

47
.github/workflows/release-complete.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
# workflow name
name: 🏷Tag Repositories
# Fine-grained personal access token
# https://github.com/settings/tokens?type=beta
# token needs perms:
# actions: read/write
# commit statuses: read/write
# contents: read/write
# workflows: read/write
# copy token
# Actions secrets and variables
# github.com/<owner>/<repo>/settings/secrets/actions
# repository secret
# name a new secret "ALTTPER_TAGGER"
# value set to copied token
# fire on
on:
release:
types:
- released
jobs:
# Tag Baserom
tag-baserom:
name: 🖳Tag Baserom
runs-on: ${{ matrix.os-name }}
strategy:
matrix:
os-name: [
# ubuntu-latest
"ubuntu-22.04"
]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
- name: 🏷Tag Repository
uses: ./.github/actions/tag-repo
env:
FINE_PAT: ${{ secrets.ALTTPER_TAGGER }}
with:
repository: ${{ github.repository_owner }}/z3randomizer
ref-name: heads/OWMain
github-tag: ${{ github.event.release.tag_name }}

418
.github/workflows/release-create.yml vendored Normal file
View File

@@ -0,0 +1,418 @@
# workflow name
name: Test/🔨Build/🚀Deploy
# fire on
on: [
push,
pull_request
]
# on:
# push:
# branches:
# - DoorDevUnstable
# - DoorDev
# - OverworldShuffleDev
# - OverworldShuffle
# pull_request:
# branches:
# - DoorDevUnstable
# - DoorDev
# - OverworldShuffleDev
# - OverworldShuffle
# stuff to do
jobs:
# Diagnostics
diags:
# diagnostics
# call checkout
# call install python
# print python version
# call install
# call analyze github actions
# install extra python modules
# run diagnostics
name: 🧮
runs-on: ${{ matrix.os-name }}
continue-on-error: True
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
ubuntu-20.04,
macos-latest, # macos-12
windows-latest # windows-2022
]
#TODO: Python Version to run on
python-version: [ "3.12" ]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
# call install python
- name: 💿Install Python
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
# print python version
- name: 🐍Python Version
shell: bash
run: |
python --version
# call install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: diags
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# call analyze github actions
- name: Analyze used GitHub Actions
shell: bash
run: |
python ./resources/ci/common/list_actions.py
# install extra python modules
- name: 💿Install extra Python Modules
shell: bash
run: |
python -m pip install setuptools
# run diagnostics
- name: 🧮Print Diagnostics
shell: bash
run: |
python -m source.meta.run_diags
# Test
install-test:
# test
# call checkout
# call install
# run tests
name: 💿/⏱️
runs-on: ${{ matrix.os-name }}
continue-on-error: False
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
ubuntu-20.04,
macos-latest, # macos-12
windows-latest # windows-2022
]
#TODO: Python Version to run on
python-version: [ "3.12" ]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
# call install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: test
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# call test
- name: Call Test
uses: ./.github/actions/test
with:
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# Prepare AppVersion
appversion-prepare:
# prepare appversion
# call checkout
# call install
# call appversion-prepare
name: 💬
runs-on: ${{ matrix.os-name }}
needs: [install-test]
continue-on-error: False
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
]
#TODO: Python Version to run on
python-version: [ "3.12" ]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
# call install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: appversion-prepare
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# call appversion-prepare
- name: 💬Call Prepare AppVersion
uses: ./.github/actions/appversion-prepare
# Build
install-build:
# build
# call checkout
# call install
# call build
name: 💿/🔨
runs-on: ${{ matrix.os-name }}
needs: [appversion-prepare]
continue-on-error: False
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
ubuntu-20.04,
macos-latest, # macos-12
windows-latest # windows-2022
]
#TODO: Python Version to run on
python-version: [ "3.12" ]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
# call install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: build
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# call build
- name: 🔨Call Build
uses: ./.github/actions/build
with:
calling-job: build
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# Prepare Release
release-prepare:
# prepare release
# call checkout
# install extra python modules
# call prepare release
name: 💿/📀->📦
runs-on: ${{ matrix.os-name }}
needs: [install-build]
continue-on-error: False
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
ubuntu-20.04,
macos-latest, # macos-12
windows-latest # windows-2022
]
python-version: [ "3.12" ]
steps:
# call checkout
- name: Checkout commit
uses: actions/checkout@v4.1.4
# install extra python modules
- name: 💿Install extra Python Modules
shell: bash
run: |
python -m pip install setuptools
# call prepare release
- name: 📀->📦Prepare Release
uses: ./.github/actions/release-prepare
with:
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# Deploy Release
# Needs to be top-level for SECRET to work easily
release-deploy:
name: 📀->🚀
runs-on: ${{ matrix.os-name }}
needs: [release-prepare]
strategy:
matrix:
#TODO: OS List to run on
os-name: [
# ubuntu-latest, # ubuntu-22.04
ubuntu-22.04,
]
#TODO: Python Version to run on
python-version: [ "3.12" ]
steps:
# checkout commit
- name: Checkout commit
uses: actions/checkout@v4.1.4
# install extra python modules
- name: 💿Install extra Python Modules
shell: bash
run: |
python -m pip install pytz requests
# get parent dir
- name: 📁Get Parent Directory
id: parentDir
uses: ./.github/actions/get-parent-dir
# download appversion artifact
- name: 🔽Download AppVersion Artifact
uses: actions/download-artifact@v4.1.7
with:
name: appversion
path: ${{ steps.parentDir.outputs.parentDir }}/build
# download ubuntu archive artifact
- name: 🔽Download Ubuntu Archive Artifact
uses: actions/download-artifact@v4.1.7
with:
# should run on latest explicit ubuntu version
name: archive-ubuntu-22.04-py${{ matrix.python-version }}
path: ${{ steps.parentDir.outputs.parentDir }}/deploy/linux
# download macos archive artifact
- name: 🔽Download MacOS Archive Artifact
uses: actions/download-artifact@v4.1.7
with:
name: archive-macos-latest-py${{ matrix.python-version }}
path: ${{ steps.parentDir.outputs.parentDir }}/deploy/macos
# download windows archive artifact
- name: 🔽Download Windows Archive Artifact
uses: actions/download-artifact@v4.1.7
with:
name: archive-windows-latest-py${{ matrix.python-version }}
path: ${{ steps.parentDir.outputs.parentDir }}/deploy/windows
# determine linux archive asset
- name: ❔Identify Linux Archive Asset
id: identify-linux-asset
shell: bash
run: |
ASSET_LINUX="$(ls ${{ steps.parentDir.outputs.parentDir }}/deploy/linux)"
echo "asset_linux=$ASSET_LINUX" >> $GITHUB_OUTPUT
# determine macos archive asset
- name: ❔Identify MacOS Archive Asset
id: identify-macos-asset
shell: bash
run: |
ASSET_MACOS="$(ls ${{ steps.parentDir.outputs.parentDir }}/deploy/macos)"
echo "asset_macos=$ASSET_MACOS" >> $GITHUB_OUTPUT
# determine windows archive asset
- name: ❔Identify Windows Archive Asset
id: identify-windows-asset
shell: bash
run: |
ASSET_WIN="$(ls ${{ steps.parentDir.outputs.parentDir }}/deploy/windows)"
echo "asset_windows=$ASSET_WIN" >> $GITHUB_OUTPUT
# archive listing
# - name: Archive Listing
# shell: bash
# run: |
# ls -R ${{ steps.parentDir.outputs.parentDir }}/deploy/
# debug info
#TODO: Project Name
- name: 📝Debug Info
id: debug_info
run: |
PROJECT_NAME="ALttPDoorRandomizer"
echo "project_name=$PROJECT_NAME" >> $GITHUB_OUTPUT
GITHUB_TAG="$(head -n 1 ../build/app_version.txt)"
echo "github_tag=$GITHUB_TAG" >> $GITHUB_OUTPUT
RELEASE_NAME="${PROJECT_NAME} ${GITHUB_TAG}"
echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT
ASSET_PREFIX="${PROJECT_NAME}-${GITHUB_TAG}"
echo "asset_prefix=$ASSET_PREFIX" >> $GITHUB_OUTPUT
echo "Project Name: ${PROJECT_NAME}"
echo "Release Name: ${RELEASE_NAME}"
echo "Asset Prefix: ${ASSET_PREFIX}"
echo "Git Tag: ${GITHUB_TAG}"
echo "Linux Asset: ${{ steps.identify-linux-asset.outputs.asset_linux }}"
echo "MacOS Asset: ${{ steps.identify-macos-asset.outputs.asset_macos }}"
echo "Windows Asset: ${{ steps.identify-windows-asset.outputs.asset_windows }}"
# create a release (MASTER)
#TODO: Make sure we updated RELEASENOTES.md
#TODO: Make sure we're firing on the proper branches
# if: contains(github.ref, 'master') # branch or tag name
# if: contains(github.event.head_commit.message, 'Version bump') # commit message
- name: 📀->🚀Create a Release (MASTER)
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.debug_info.outputs.github_tag }}
release_name: ${{ steps.debug_info.outputs.release_name }}
body_path: RELEASENOTES.md
# draft: true
if: contains(github.ref, 'master')
# upload linux archive asset (MASTER)
#TODO: Make sure we're firing on the proper branches
- name: 🔼Upload Linux Archive Asset (MASTER)
id: upload-linux-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.parentDir.outputs.parentDir }}/deploy/linux/${{ steps.identify-linux-asset.outputs.asset_linux }}
asset_name: ${{ steps.debug_info.outputs.asset_prefix }}-linux-focal.tar.gz
asset_content_type: application/gzip
if: contains(github.ref, 'master')
# upload macos archive asset (MASTER)
#TODO: Make sure we're firing on the proper branches
- name: 🔼Upload MacOS Archive Asset (MASTER)
id: upload-macos-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.parentDir.outputs.parentDir }}/deploy/macos/${{ steps.identify-macos-asset.outputs.asset_macos }}
asset_name: ${{ steps.debug_info.outputs.asset_prefix }}-osx.tar.gz
asset_content_type: application/gzip
if: contains(github.ref, 'master')
# upload windows archive asset (MASTER)
#TODO: Make sure we're firing on the proper branches
- name: 🔼Upload Windows Archive Asset (MASTER)
id: upload-windows-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.parentDir.outputs.parentDir }}/deploy/windows/${{ steps.identify-windows-asset.outputs.asset_windows }}
asset_name: ${{ steps.debug_info.outputs.asset_prefix }}-windows.zip
asset_content_type: application/zip
if: contains(github.ref, 'master')