Skip to content

Commit

Permalink
Update the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KapiWilq committed Nov 14, 2024
1 parent 6ae9012 commit bd29a29
Showing 1 changed file with 62 additions and 7 deletions.
69 changes: 62 additions & 7 deletions .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,89 @@
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
uses: actions/checkout@v4
- 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:
name: v${{ env.OVERLAY_VERSION }}
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

0 comments on commit bd29a29

Please sign in to comment.