Skip to content

Created blueprint extension and changed base script to be able to run as tapermonkey addon and as extension#2

Open
sirzento wants to merge 4 commits into
Ricman-MC:mainfrom
sirzento:main
Open

Created blueprint extension and changed base script to be able to run as tapermonkey addon and as extension#2
sirzento wants to merge 4 commits into
Ricman-MC:mainfrom
sirzento:main

Conversation

@sirzento

@sirzento sirzento commented Apr 14, 2025

Copy link
Copy Markdown

I will leave this pull request here so you don't have as much work to do for implementing it as extension.

ATTENTION, this update will break existing configurations since the keys got changed to be matched with the keys used inside the ptero DB.

Since the script is now inside dashboard/wrapper.blade.php you need to change your release logic to use this file and remove the <script> tag at the beginning and at the end of the file to be used with tapermonkey.

So any future changes to your script should be made at the wrapper.blade.php file.

To create the blueprint extension file, just zip everything and name the zip file pterosort.blueprint.
When updating the script, you also need to change the version inside the conf.yml to the same version you use inside the script.
I have changed both versions to 1.3.0 now to get them to the same version.

I also added a short explanation on how to install the extension to the readme.md.

@sirzento

Copy link
Copy Markdown
Author

Let me just try out those release actions. Never used those before. I will write here again if I got the right ones working :D

@sirzento

Copy link
Copy Markdown
Author

Alright, its ready now.
When creating a new relase, a pterosort.blueprint and pterosort.js will be created aswell. The new action is already included inside the pull request but here is the code for it:

name: Zip and Attach to Release
on:
  release:
    types: [created]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Create ZIP archive
        run: |
          zip -r pterosort.blueprint . -x "*.git*" "*node_modules*" ".editorconfig"

      - name: Extract JS from wrapper.blade.php
        run: |
          sed -n '/<script>/,/<\/script>/p' ./dashboard/wrapper.blade.php | \
          sed '1d;$d' > pterosort.js

      - name: Upload Release Assets
        uses: softprops/action-gh-release@v1
        with:
          files: |
            pterosort.blueprint
            pterosort.js
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant