From 2810f6afc11bdc33a1b6492b33d285f430829099 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 14 May 2022 13:07:57 -0400 Subject: [PATCH] ci: update docs --- .github/workflows/architecture/README.md | 9 ++++++++- .github/workflows/release_new_tag.yml | 11 ++++++++++- .../workflows/scripts/common/name-artifacts.sh | 10 ++++++---- .../scripts/releases/rename-release-assets.py | 18 +++++++++--------- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/architecture/README.md b/.github/workflows/architecture/README.md index 88d6f4b269..28bb909a89 100644 --- a/.github/workflows/architecture/README.md +++ b/.github/workflows/architecture/README.md @@ -3,5 +3,12 @@ ## Releases ```mermaid - +sequenceDiagram + PCSX2 Repo->>Actions: PR is merged or commit is pushed to master + Actions->>PCSX2 Repo: Increment latest tag and push, create a draft release + Actions->>Actions: Kicked off pipeline on the tag push, build relevant configs + Actions->>PCSX2 Repo: Rename and upload artifacts to draft release, publish the release + Actions->>Discord: Announce release via a WebHook + PCSX2 Repo->>Web API: POST webhook to API informing it that a new release has occurred + Web API->>Web API: Update cache with new release ``` diff --git a/.github/workflows/release_new_tag.yml b/.github/workflows/release_new_tag.yml index 14535e6e05..55219b399d 100644 --- a/.github/workflows/release_new_tag.yml +++ b/.github/workflows/release_new_tag.yml @@ -22,7 +22,7 @@ on: # required: true jobs: - tag-master: + cut-release: if: github.repository == 'PCSX2/pcsx2' runs-on: ubuntu-latest name: "Create Tag and Release" @@ -40,6 +40,15 @@ jobs: tag_prefix: v default_bump: patch + # TODO - we could do this and remove the node.js script, but auto-generated notes only work + # with PRs -- not commits (determine how much we care). + # - name: Create Draft Release + # env: + # GITHUB_TOKEN: ${{ secrets.BOT_PAT }} + # run: | + # echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}" + # gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }} + - name: Generate Release Notes env: OWNER: PCSX2 diff --git a/.github/workflows/scripts/common/name-artifacts.sh b/.github/workflows/scripts/common/name-artifacts.sh index 6a78b88791..ac63cdd326 100755 --- a/.github/workflows/scripts/common/name-artifacts.sh +++ b/.github/workflows/scripts/common/name-artifacts.sh @@ -1,6 +1,8 @@ +#!/bin/bash + # Artifact Naming Scheme: # PCSX2---[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\] -# -- limited to 150 chars +# -- limited to 200 chars # Outputs: # - artifact-name @@ -25,7 +27,7 @@ else fi # Add PR / Commit Metadata -if [ $EVENT_NAME == "pull_request" ]; then +if [ "$EVENT_NAME" == "pull_request" ]; then PR_SHA=$(git rev-parse --short "${PR_SHA}") if [ ! -z "${PR_NUM}" ]; then NAME="${NAME}-pr[${PR_NUM}]" @@ -33,7 +35,7 @@ if [ $EVENT_NAME == "pull_request" ]; then NAME="${NAME}-sha[${PR_SHA}]" if [ ! -z "${PR_TITLE}" ]; then PR_TITLE=$(echo "${PR_TITLE}" | tr -cd '[a-zA-Z0-9[:space:]]_-') - NAME="${NAME}-title["${PR_TITLE}"" + NAME="${NAME}-title[${PR_TITLE}" fi else SHA=$(git rev-parse --short "$GITHUB_SHA") @@ -42,5 +44,5 @@ fi # Trim the Name NAME=$(printf "%.199s]" "$NAME") -echo ${NAME} +echo "${NAME}" echo "##[set-output name=artifact-name;]${NAME}" diff --git a/.github/workflows/scripts/releases/rename-release-assets.py b/.github/workflows/scripts/releases/rename-release-assets.py index a1d345b7fc..e13ee7a381 100644 --- a/.github/workflows/scripts/releases/rename-release-assets.py +++ b/.github/workflows/scripts/releases/rename-release-assets.py @@ -7,38 +7,38 @@ output_dir = os.environ['OUT_DIR'] accepted_exts = ["AppImage", "tar.gz", "7z"] -for dir in os.listdir(scan_dir): +for dir_name in os.listdir(scan_dir): asset_name = "pcsx2-{}".format(tag) - if "macos" in dir.lower(): + if "macos" in dir_name.lower(): asset_name += "-macos" - elif "linux" in dir.lower(): + elif "linux" in dir_name.lower(): asset_name += "-linux-AppImage-64bit" - elif "windows" in dir.lower(): + elif "windows" in dir_name.lower(): asset_name += "-windows-64bit" - if "avx" in dir.lower(): + if "avx" in dir_name.lower(): asset_name += "-AVX2" else: asset_name += "-SSE4" else: continue; - if "wxwidgets" in dir.lower(): + if "wxwidgets" in dir_name.lower(): asset_name += "-wxWidgets" else: asset_name += "-Qt" - if "symbols" in dir.lower(): + if "symbols" in dir_name.lower(): asset_name += "-symbols" print(asset_name) dir_handled = False - for file in os.listdir(os.path.join(scan_dir, dir)): + for file in os.listdir(os.path.join(scan_dir, dir_name)): for ext in accepted_exts: if file.endswith(ext): dir_handled = True print("Moving {} to out dir".format(file)) - shutil.move(os.path.join(scan_dir, dir, file), os.path.join(output_dir, asset_name + "." + ext)) + shutil.move(os.path.join(scan_dir, dir_name, file), os.path.join(output_dir, asset_name + "." + ext)) break if dir_handled: break