Owr actions update (#19)

* Go for Broke

* Let it fire

* Add PipLine

* Create the dir if it doesn't exist

* Install Setuptools

* Track Test Action's files

* Fix Calling Job

* Track Build Action files

* Install Distutils, rename filenames

* Fix Fail conditions

* Make Build scripts smarter

* Add file

* Concat DLLs lists

* Try to fail if Error DLLs

* Try to make the fail smarter

* Moar verbosity

* Print the stuff first

* Print outputs objects

* See if this skips failure

* Use py instead

* Print error list

* Don't ValueError

* Try checking a different way

* Try something else

* Bleh, spell filename correctly

* Update excluded_dlls.json

* Ugh, gotta compare old to new somehow

* Compare to old list

* Condense build script

* Moar verbosity

* Update the global version

* Update Excluded DLLs list

* Actually use the bad DLLs list

* Make a version number

* Fix version number building

* Fix version number building again

* Fix Diagnostics

* Try REST API stuff

* Try REST API again

* Moar REST

* await

* Get SHA

* Try it all together

* Del test workflow

* Add Perms

* Use a Token

* Try this Token

* Try different Token

* Try different Token

* Create App Version earlier

* See this error again

* Don't fail if App Version not made yet

* Use New Secret

* Print whole response

* Documentation for Tagger

* Update CI Instructions

* Update CI

* List References

* Find latest tag

Fix App Version getter

* Fix commas

* Check returned data

* Update Build Script

* Fix substring

* Fix Git tag

* Fix tag again

* Visual indicators

* Use encoding

* Remove an indicator

* Update CI

* Update Project Name

* PyInstaller Spec Template file

* Update Build Script

* Fix Tagger

* Update CI

* Download AppVersion during build

* Test job can fail

* Upload Logs instead of printing them

* Change from Reusable Workflow to Action

* Change ref to token

* Compare to string

* Use PAT

* Use String literal

* Remove Reusable Workflow

* Update CI Scripts

* Go for Broke

* Let it fire

* Add PipLine

* Create the dir if it doesn't exist

* Install Setuptools

* Track Test Action's files

* Fix Calling Job

* Track Build Action files

* Install Distutils, rename filenames

* Fix Fail conditions

* Make Build scripts smarter

* Add file

* Concat DLLs lists

* Try to fail if Error DLLs

* Try to make the fail smarter

* Moar verbosity

* Print the stuff first

* Print outputs objects

* See if this skips failure

* Use py instead

* Print error list

* Don't ValueError

* Try checking a different way

* Try something else

* Bleh, spell filename correctly

* Update excluded_dlls.json

* Ugh, gotta compare old to new somehow

* Compare to old list

* Condense build script

* Moar verbosity

* Update the global version

* Update Excluded DLLs list

* Actually use the bad DLLs list

* Make a version number

* Fix version number building

* Fix version number building again

* Fix Diagnostics

* Try REST API stuff

* Try REST API again

* Moar REST

* await

* Get SHA

* Try it all together

* Del test workflow

* Add Perms

* Use a Token

* Try this Token

* Try different Token

* Try different Token

* Create App Version earlier

* See this error again

* Don't fail if App Version not made yet

* Use New Secret

* Print whole response

* Documentation for Tagger

* Update CI Instructions

* Update CI

* List References

* Find latest tag

Fix App Version getter

* Fix commas

* Check returned data

* Update Build Script

* Fix substring

* Fix Git tag

* Fix tag again

* Visual indicators

* Use encoding

* Remove an indicator

* Update CI

* Update Project Name

* PyInstaller Spec Template file

* Update Build Script

* Fix Tagger

* Update CI

* Download AppVersion during build

* Test job can fail

* Upload Logs instead of printing them

* Change from Reusable Workflow to Action

* Change ref to token

* Compare to string

* Use PAT

* Use String literal

* Remove Reusable Workflow

* Update CI Scripts

---------

Co-authored-by: Minnie A. Trethewey (Mike) <minnietrethewey@gmail.com>
This commit is contained in:
codemann8
2024-05-23 19:29:39 -05:00
committed by GitHub
parent 9eb5293a3c
commit b55c3700c0
39 changed files with 2076 additions and 588 deletions

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="ALttPOverworldRandomizer"
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')