diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7923233 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,50 @@ +name: Publish package + +on: + push: + tags: + - "*" + +env: + name: ${{github.event.repository.name}} # Edit this if the package name differs from the repo name + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get clean version + run: | + echo cleanVersion=$(echo ${{github.ref_name}} | sed s/v//g) >> $GITHUB_ENV + - name: Check that version matches + run: | + if [[ "$(grep -Po "\d+\.\d+\.\d+" $(find ./ -name mod.json))" != "${{ env.cleanVersion }}" ]]; then + echo "::debug::${{env.cleanVersion}}" + echo "::debug::$(cat $(find ./ -name mod.json ))" + echo "::error::Version in mod.json does not match tag version" + exit 1 + fi + publish: + runs-on: ubuntu-latest + needs: verify + steps: + - uses: actions/checkout@v3 + - name: Upload Thunderstore Package + uses: GreenTF/upload-thunderstore-package@v3.1 + with: + community: northstar + # Name of the team to publish the mod under + # This should be modified if your github username is different than your team name on Thunderstore + namespace: ${{ github.repository_owner }} # <------ DOUBLE CHECK THIS + # Name of the package + name: ${{ env.name }} # This can be modified if the package name differs from the repo name + # Package version to publish + version: ${{ github.ref_name }} # This is the tag that was created in the release + # Description of the mod + description: Example mod description # <----------- UPDATE THIS + # Thunderstore API token + token: ${{ secrets.TS_KEY }} + # Directory to wrap the contents of the repo in + wrap: mods/${{ github.repository_owner }}.${{ env.name }} # This will wrap your Author.ModName folder in a mods/ folder before publishing + #deps: "northstar-Northstar@1.9.3" # <------------- Uncomment this line to add dependencies to your mod, each sparated by a space + categories: "mods" # <----------------------------- Add more categories as needed, separated by spaces diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..903a4c9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Emerald + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a825f09 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# NSModTemplate +A template repository for Northstar mods with a ~~mostly~~ pre-configured github action for publishing to Thunderstore + +## Usage +
Use this template
button on the top right of the repo's landing page (here)public
settings
tab, under actions
-> general
, set Actions permissions
to Allow all actions and reusable workflows
settings
, under secrets
-> actions
, add your Thunderstore token as a secret named TS_KEY
(Steps for getting a token can be found here).github/workflows/publish.yml
~line 43 to add a description for your mod icon.png
as they will be used by Thunderstore as well Version
field in your mod.json
should be 1.0.0
:
+ Actions
tab :D
+