Wplace-BlueMarble/.github/workflows/build.yml
SwingTheVine bd10a420f6
Begin update for v0.83.0 (#188)
* Create CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Added some install instructions

* Finished CONTRIBUTING.md

* Fixed CONTRIBUTING table

* Added SECURITY.md

* Added Computer Edge instructions

* Added Computer FireFox instructions

* Clarified where the userscript can be downloaded from

* Update to Wiki Docs

* Simplify installation instructions with one-click install links

This is because Tampermonkey automagically detect whether raw js files are being opened and redirect user to installation page. We might need a custom build action to update the links though.

- Replace manual download and drag process with direct install links
- Remove unnecessary screenshots and dashboard steps

* Fix stuff

* Fixed again. Sorry I was looking at the wrong branch T-T

* .

* Added color palette to src/utils.js

* Updated Shields to match HEAD of main

* Added build.yml RegEx for v0.0.0 version updating in README.md

* Branch sync

* Update CONTRIBUTING.md

* Added the quick guide

* Added wplace status shield

* Moved wiki to its own branch

* Added Shields from #61 and #58

* Fixed PR template

* Squashed commit of the following:

commit aca7df4189
Author: SwingTheVine <swingthevine@gmail.com>
Date:   Sat Aug 9 20:52:22 2025 -0400

    Added color palette to src/utils.js

commit 13ff8fbe33
Merge: 70eb0a2 f2d34d8
Author: SwingTheVine <swingthevine@gmail.com>
Date:   Sat Aug 9 20:49:26 2025 -0400

    Merge branch 'main' of https://github.com/SwingTheVine/Wplace-BlueMarble

commit 70eb0a26fa
Author: SwingTheVine <swingthevine@gmail.com>
Date:   Fri Aug 8 19:38:49 2025 -0400

    Update to Wiki Docs

* Fixed bug in JSDoc generation in build.js

* v0.79.0; Merge pull request #98 from SwingTheVine/documentation

Updated documentation

* Added missing dependency for minami

* Added brief description about what Blue Marble does

* Added missing dependency for minami

* Added brief description about what Blue Marble does

* Added missing dependency for minami

* Added brief description about what Blue Marble does

* v0.80.0; Added brief description about what Blue Marble does

* v0.80.0; Added brief description about what Blue Marble does

* Added a Shield for Pages

* Added markdown support to the wiki

* fixed broken links

firefox related links were broken

* fixed latest pre-releases links

* Cleanup of bugs related to one-click install link

* feat: Add new official Blue Marble website and update documentation

Add newly created official Blue Marble website and update project documentation

- Add official website badge to README.md
- Include website link in Quick Guide section
- Add website creator credits in CREDITS.md
- Update CONTRIBUTING.md with website reference
- Add new official website URL: https://bluemarble.camilledaguin.fr/

This commit introduces the newly created official Blue Marble website
and updates all documentation to reference it. The website provides
a dedicated platform for Blue Marble users and information.

* Markdown links are used in CREDITS.md

* Website Shield Moved Next to Social Shields

* Website should not take priority over download information...

...also, removed the word "official" due to the fact that the website being linked on the GitHub indicates that the website is official. Just like how the Discord server being linked on GitHub indicates that the Discord server is "official."

* Since the website does not contain security information...

...it should not be in SECURITY.md

* Removed redundant @website meta attribute...

...since @website and @homepageURL do the exact same thing

* Added @WondaMegapon to the CREDITS.md file

* Fix some issues with the README (#124)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Update README.md

Fix some issues with the readme

* Added version Shield back

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update documentation branch (#164)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

---------

Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update Wplace status badge (#140)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

* Update Wplace status badge

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix spelling mistakes (#151)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

* Fix spelling mistakes

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Remove `@run-at` (#161)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

* Remove `@run-at`

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update `@match` to match only the frontend (#162)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

* Updae `@match` to match only the frontend

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: correction of typographical errors (#178)

* Added ignore files to stop popular code formatters from messing with the code style

* Change transform easing to 0s

* Added a translucent gray checkerboard render for #deface

* Added workflow to check what branch PR came from

* v0.81.0; Merge branch 'code' into main

* Emergency patch...

...please stop informing me that the install link is broken 😭

* v0.82.0; Emergency patch...

...please stop informing me that the install link is broken 😭

* docs: correction of typographical errors

recieved -> received

---------

Co-authored-by: SwingTheVine <swingthevine@gmail.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: thatfrozenfrog <101154752+thatfrozenfrog@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cyberflixt <54700008+Cyberflixt@users.noreply.github.com>
Co-authored-by: Iris <camille.daguin1@gmail.com>
Co-authored-by: windbus <103200560+windigerbus@users.noreply.github.com>
Co-authored-by: AloeSapling <aloesapling@gmail.com>
Co-authored-by: Endrik Tombak <littleendu@gmail.com>
Co-authored-by: KrunchyKrisp <m.damidavicius@gmail.com>
Co-authored-by: SobakinTech <sobakintech@gmail.com>
Co-authored-by: Agatem <agaatem@outlook.com>
Co-authored-by: Nemupy <82650472+Nemupy@users.noreply.github.com>
2025-08-17 01:00:05 -04:00

227 lines
7.7 KiB
YAML

name: Bump, Build, Release
on:
push:
branches:
- main
jobs:
# Updates the Auto branch to match Main
update-auto:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Update Auto To Main
run: |
git fetch origin
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git checkout auto || git checkout -b auto
git reset --hard origin/main
git push --force origin auto
# Builds the code
# This is bundling, obfuscating, version bumping, etc.
build:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [update-auto] # Needs the update-auto job to finish first
outputs:
TITLE: ${{ steps.get-commit-message.outputs.TITLE }}
BODY: ${{ steps.get-commit-message.outputs.BODY }}
CURRENT_VERSION: ${{ steps.get_version.outputs.current_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Update userscript version
run: |
npm version minor --no-git-tag-version
node build/update-version.js
- name: Build userscript
run: npm run build
- name: Get current version
id: get_version
run: |
current_version=$(jq -r '.version' package.json)
echo "Current version: $current_version"
echo "current_version=$current_version" >> $GITHUB_OUTPUT
- name: Get latest release tag (no "v" prefix)
id: get_latest_tag
run: |
latest_tag=$(gh release list --limit 1 --exclude-drafts --exclude-pre-releases=false | head -n 1 | awk '{print $1}')
latest_tag_no_v=${latest_tag#v}
echo "latest_tag_no_v=$latest_tag_no_v" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update static version numbers
run: |
current_version="${{ steps.get_version.outputs.current_version }}"
latest_tag="${{ steps.get_latest_tag.outputs.latest_tag_no_v }}"
if [ -f "docs/README.md" ]; then
echo "README.md exists. Modifying..."
sed -i \
-e 's|\(Latest_Version-\)[^-\ ]*\(-lightblue\)|\1'"$current_version"'\2|' \
docs/README.md
else
echo "README.md was not found. Skipping..."
fi
- name: Update compression badge
run: |
dist_size=$(find dist -type f -exec cat {} + | wc -c)
src_size=$(find src dist/assets -type f -exec cat {} + | wc -c)
percentage=$(awk "BEGIN {printf \"%.2f\", 100 - ($dist_size * 100) / $src_size}")
echo "Compression: $percentage"
badge_url="https://img.shields.io/badge/Compression-${percentage}%25-blue"
sed -i -E 's#https://img.shields.io/badge/Compression-[^"]*#'"$badge_url"'#' docs/README.md
- name: Get the previous commit message
id: get-commit-message
run: |
COMMIT_MSG="$(git log -1 --pretty=%B)"
TITLE="$(echo "$COMMIT_MSG" | head -n1)"
BODY="$(echo "$COMMIT_MSG" | tail -n +2)"
{
echo "TITLE<<EOF"
echo "$TITLE"
echo "EOF"
echo "BODY<<EOF"
echo "$BODY"
echo "EOF"
} >> $GITHUB_OUTPUT
# This should happen on 'auto' branch
- name: Commit and push built script
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git checkout auto || git checkout -b auto
git add dist/*
git add src/BlueMarble.meta.js
git add package.json
git add docs/README.md
git commit -m "Bumped version; ${{ steps.get-commit-message.outputs.TITLE }}" -m "${{ steps.get-commit-message.outputs.BODY }}" || echo "No changes to commit"
git push --set-upstream origin auto
# Updates the requirement link SHA
update-requirements:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [update-auto, build] # Needs the update-auto and build jobs to finish first
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: auto # Checks out the auto branch
fetch-depth: 0
- name: Get SHA of origin/auto
run: |
git fetch origin auto
AUTO_SHA=$(git rev-parse origin/auto)
echo "Auto SHA: $AUTO_SHA"
echo "AUTO_SHA=$AUTO_SHA" >> $GITHUB_ENV
- name: Update Resource Link SHA
run: |
echo "Auto SHA: $AUTO_SHA"
sed -i "/@icon/ s#/[a-f0-9]\{40\}/#/${AUTO_SHA}/#g" dist/BlueMarble.user.js src/BlueMarble.meta.js
sed -i "/@resource/ s#/[a-f0-9]\{40\}/#/${AUTO_SHA}/#g" dist/BlueMarble.user.js src/BlueMarble.meta.js
echo "Updated resourceLinkSHA:"
grep "@icon" dist/BlueMarble.user.js src/BlueMarble.meta.js
grep "@resource" dist/BlueMarble.user.js src/BlueMarble.meta.js
env:
AUTO_SHA: ${{ env.AUTO_SHA }}
- name: Commit Resource Link SHA
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add dist/BlueMarble.user.js
git add src/BlueMarble.meta.js
git commit -m "Merge version; ${{ needs.build.outputs.TITLE }}" -m "${{ needs.build.outputs.BODY }}" || echo "No changes to commit"
git push
- name: Merge Auto -> Main
run: |
git fetch origin
git checkout origin/main -B main
git merge --squash origin/auto
git commit -m "v${{ needs.build.outputs.CURRENT_VERSION }}; ${{ needs.build.outputs.TITLE }}" -m "${{ needs.build.outputs.BODY }}" || echo "No changes to commit"
git push origin main
update-wiki:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [update-auto, build, update-requirements] # Needs the update-auto, build, and update-requirements jobs to finish first
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Force update wiki branch
run: |
git fetch origin
git branch -f wiki origin/main
git push origin wiki --force
- name: Checkout wiki branch
run: git checkout wiki
- name: Install dependencies
run: |
npm ci
npm install minami taffydb
- name: Generate JSDoc from jsdoc.json
run: |
npx jsdoc -c jsdoc.json
- name: Commit and push to wiki branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add docs
git commit -m "Update wiki via JSDoc" || echo "No changes to commit"
git push origin wiki