From bd29a29282d7843ce03070aa52af1118203cee82 Mon Sep 17 00:00:00 2001 From: KapiWilq Date: Fri, 15 Nov 2024 00:24:23 +0100 Subject: [PATCH] Update the workflow --- .github/workflows/new-release.yml | 69 +++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 9a19909..e9dc74c 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -1,8 +1,8 @@ name: Create a new release of the overlay on: workflow_dispatch jobs: - prepare-release: - name: Prepare the release + get-overlay-version: + name: Get the overlay version runs-on: ubuntu-latest steps: - name: Download the repo @@ -10,13 +10,66 @@ jobs: - name: Get the overlay version run: | echo "OVERLAY_VERSION=$(cat metadata.txt | grep "Version: " | cut -c 10-)" >> $GITHUB_ENV + + prepare-release: + name: Prepare the release + runs-on: ubuntu-latest + needs: get-overlay-version + steps: + - name: Download the repo + uses: actions/checkout@v4 + - name: Remove debug logging from the HTML file + run: | + echo "DEBUGGING_LINE_NUMBER=$(grep -n "// In-game debugging" file2.txt | cut -d : -f 1)" >> $GITHUB_ENV + sed '${{ env.DEBUGGING_LINE_NUMBER }}{/.*/d}' index.html > index.html - name: Put the repo into the ZIP archive run: | rm -rf HitErrorMeter.by.KapiWilq.zip cd ../ cp -r HitErrorMeter HitErrorMeter\ by\ KapiWilq - zip -r HitErrorMeter.by.KapiWilq.zip HitErrorMeter\ by\ KapiWilq -x "HitErrorMeter\ by\ KapiWilq/.git/*" "HitErrorMeter\ by\ KapiWilq/.github/*" "HitErrorMeter\ by\ KapiWilq/README.md" + zip -r HitErrorMeter.by.KapiWilq.zip HitErrorMeter\ by\ KapiWilq -x "HitErrorMeter\ by\ KapiWilq/.git/*" "HitErrorMeter\ by\ KapiWilq/.github/*" "HitErrorMeter\ by\ KapiWilq/README.md" "HitErrorMeter\ by\ KapiWilq/.eslintrc.json" mv HitErrorMeter.by.KapiWilq.zip HitErrorMeter/ + - name: Upload the artifact + uses: actions/upload-artifact@v4 + with: + name: hiterrormeter by kapiwilq.zip + path: HitErrorMeter.by.KapiWilq.zip + + prepare-debug-release: + name: Prepare the debug release + runs-on: ubuntu-latest + needs: get-overlay-version + steps: + - name: Download the repo + uses: actions/checkout@v4 + - name: Get the latest commit ID + run: | + echo "LATEST_COMMIT_ID=$(git log --format="%H" -n 1 | cut -c 7-)" >> $GITHUB_ENV + - name: Modify the version in the metadata folder + run: | + sed "/Version: / s/Version: .*/Version: v${{env.OVERLAY_VERSION}}-DEBUG-${{env.LATEST_COMMIT_ID}}/" metadata.txt > metadata.txt + - name: Put the repo into the ZIP archive + run: | + rm -rf HitErrorMeter.by.KapiWilq.Debug.zip + cd ../ + cp -r HitErrorMeter HitErrorMeter\ by\ KapiWilq + zip -r HitErrorMeter.by.KapiWilq.Debug.zip HitErrorMeter\ by\ KapiWilq -x "HitErrorMeter\ by\ KapiWilq/.git/*" "HitErrorMeter\ by\ KapiWilq/.github/*" "HitErrorMeter\ by\ KapiWilq/README.md" "HitErrorMeter\ by\ KapiWilq/.eslintrc.json" + mv HitErrorMeter.by.KapiWilq.Debug.zip HitErrorMeter/ + - name: Upload the artifact + uses: actions/upload-artifact@v4 + with: + name: hiterrormeter by kapiwilq (debug).zip + path: HitErrorMeter.by.KapiWilq.Debug.zip + + publish: + name: Publish the release + runs-on: ubuntu-latest + needs: [prepare-release, prepare-debug-release] + steps: + - name: Download the artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true - name: Publish a new release uses: softprops/action-gh-release@v2 with: @@ -24,11 +77,13 @@ jobs: tag_name: v${{ env.OVERLAY_VERSION }} token: ${{ secrets.GITHUBPAT }} body: | - Thanks for wanting to try out my overlay! + Thanks for wanting to try out my overlay! - ## Changelog - - To be done (if it's not here within 24 hours after the release then yell at me) + ## Changelog + - To be done (if it's not here within 24 hours after the release then yell at me) fail_on_unmatched_files: true - files: HitErrorMeter.by.KapiWilq.zip + files: | + hiterrormeter by kapiwilq.zip + hiterrormeter by kapiwilq (debug).zip make_latest: true