From ed9f0185b3578747e70ccbf2103592c68a4e1f39 Mon Sep 17 00:00:00 2001 From: caewok Date: Sat, 8 May 2021 04:39:05 -0700 Subject: [PATCH] Initial commit --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++ README.md | 53 ++++++++++++++++++++++++++++++++++++++ languages/en.json | 3 +++ module.json | 48 ++++++++++++++++++++++++++++++++++ scripts/lib/lib.js | 0 scripts/module.js | 7 +++++ styles/module.css | 0 8 files changed, 172 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 languages/en.json create mode 100644 module.json create mode 100644 scripts/lib/lib.js create mode 100644 scripts/module.js create mode 100644 styles/module.css diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3b1c917 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Release Creation + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Substitute the Manifest and Download URLs in the module.json + - name: Substitute Manifest and Download Links For Versioned Ones + id: sub_manifest_link_version + uses: microsoft/variable-substitution@v1 + with: + files: 'module.json' + env: + version: ${{github.event.release.tag_name}} + url: https://github.com/${{github.repository}} + manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # Create a zip file with all files required by the module to add to the release + - run: zip -r ./module.zip module.json LICENSE styles/ scripts/ templates/ languages/ + + # Create a release for this specific version + - name: Update Release with Files + id: create_version_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true # Set this to false if you want to prevent updating existing releases + name: ${{ github.event.release.name }} + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: './module.json, ./module.zip' + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d2e5bea --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Repository Owner + +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..59187c4 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +![](https://img.shields.io/badge/Foundry-v0.7.9-informational) + + + + + + + + + +# How to use this Template to create a versioned Release + +1. Open your repository's releases page. + +![Where to click to open repository releases.](https://user-images.githubusercontent.com/7644614/93409301-9fd25080-f864-11ea-9e0c-bdd09e4418e4.png) + +2. Click "Draft a new release" + +![Draft a new release button.](https://user-images.githubusercontent.com/7644614/93409364-c1333c80-f864-11ea-89f1-abfcb18a8d9f.png) + +3. Fill out the release version as the tag name. + +## Do not prefix your tag name with a `v`. + +If you want to add details at this stage you can, or you can always come back later and edit them. + +![Release Creation Form](https://user-images.githubusercontent.com/7644614/93409543-225b1000-f865-11ea-9a19-f1906a724421.png) + +4. Hit submit. + +5. Wait a few minutes. + +A Github Action will run to populate the `module.json` and `module.zip` with the correct urls that you can then use to distribute this release. You can check on its status in the "Actions" tab. + +![Actions Tab](https://user-images.githubusercontent.com/7644614/93409820-c1800780-f865-11ea-8c6b-c3792e35e0c8.png) + +6. Grab the module.json url from the release's details page. + +![image](https://user-images.githubusercontent.com/7644614/93409960-10c63800-f866-11ea-83f6-270cc5d10b71.png) + +This `module.json` will only ever point at this release's `module.zip`, making it useful for sharing a specific version for compatibility purposes. + +7. You can use the url `https://github.com///releases/latest/download/module.json` to refer to the manifest. + +This is the url you want to use to install the module typically, as it will get updated automatically. + + +# FoundryVTT Module + +Does something, probably + +## Changelog + diff --git a/languages/en.json b/languages/en.json new file mode 100644 index 0000000..86e31f2 --- /dev/null +++ b/languages/en.json @@ -0,0 +1,3 @@ +{ + "MODULE.hello": "hello" +} \ No newline at end of file diff --git a/module.json b/module.json new file mode 100644 index 0000000..6b4c9fd --- /dev/null +++ b/module.json @@ -0,0 +1,48 @@ +{ + "name": "module", + "title": "New Module", + "description": "", + "version": "This is auto replaced", + "library": "false", + "manifestPlusVersion": "1.0.0", + "minimumCoreVersion": "0.7.9", + "compatibleCoreVersion": "0.7.9", + "authors": [ + { + "name": "The League of Extraordinary FVTT Developers", + "url": "https://github.com/League-of-Foundry-Developers", + "discord": "discordID#0001" + } + ], + "dependencies": [ + + ], + "conflicts": [ + + ], + "esmodules": [ + "/scripts/module.js" + ], + "scripts": [ + "/scripts/lib/lib.js" + ], + "styles": [ + "/styles/module.css" + ], + "languages": [ + { + "lang": "en", + "name": "English", + "path": "languages/en.json" + } + ], + "url": "This is auto replaced", + "manifest": "This is auto replaced", + "download": "This is auto replaced", + "media": [ + { + "type": "icon", + "url": "https://avatars2.githubusercontent.com/u/71292812?s=400&u=ccdb4eeb7abf551ca8f314e5a9bfd0479a4d3d41&v=4" + } + ] +} diff --git a/scripts/lib/lib.js b/scripts/lib/lib.js new file mode 100644 index 0000000..e69de29 diff --git a/scripts/module.js b/scripts/module.js new file mode 100644 index 0000000..222aea5 --- /dev/null +++ b/scripts/module.js @@ -0,0 +1,7 @@ +Hooks.once('init', async function() { + +}); + +Hooks.once('ready', async function() { + +}); diff --git a/styles/module.css b/styles/module.css new file mode 100644 index 0000000..e69de29