Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bug fix #41

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
14 changes: 12 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
gulpfile.js
.eslintrc.js
.prettierrc.js
dist
jsconfig.json
/dist
/.pnp.js
/.yarn/

.github/
dist/
docs/
external/
src/languages/
src/assets/
src/lang/
src/scripts/
src/styles/
src/templates/
src/**/*.svelte
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github export-ignore
FUNDING.yml export-ignore

.gitattributes export-ignore
README.md export-ignore
preview.jpg export-ignore
patchnotes.md export-ignore
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: foundryworkshop
custom: ["https://www.patreon.com/foundryworkshop]
168 changes: 123 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,131 @@
name: Release Creation

on:
on:
release:
types: [published]
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: 'src/module.json'
env:
version: ${{github.event.release.tag_name}}
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: cd src; zip -r ./module.zip *

# 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: 'src/module.json, src/module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# Update the 'latest' release
- name: Create Release
id: create_latest_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: 'src/module.json,src/module.zip'
tag: latest
body: ${{ github.event.release.body }}
- 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_release_manifest_version
uses: microsoft/variable-substitution@v1
with:
files: 'src/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

# for a FULL RELEASE
# - name: Substitute Manifest and Download Links For Versioned Ones
# if: "!github.event.release.prerelease"
# id: sub_release_manifest_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

# Substitute the Manifest and Download URLs in the module.json
# for a PRE RELEASE. Manifest pointing to live module.json on branch,
# which is updated after tag.
# - name: Substitute Manifest and Download Links For Versioned Ones
# if: "github.event.release.prerelease"
# id: sub_prerelease_manifest_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://raw.githubusercontent.com/${{github.repository}}/next/module.json
# download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip

# Install packages.
- run: npm install

# Build distribution.
- run: npm run build

- run: mkdir package

- run: mv -v ./dist/* ./package/

# Create a zip file with all files required by the module to add to the release
#- run: zip -r ./module.zip module.json LICENSE module.js module.js.map style.css templates/ languages/ packs/ assets/
# - run: zip -r ./package/module.zip ./package/*

# && ensures that zip only runs if the directory was correctly changed,
# and the parentheses run everything in a subshell, so the current directory
# is restored at the end. Using OLDPWD avoids having to calculate the relative path to package.zip.
# https://unix.stackexchange.com/questions/385405/zip-all-files-and-subfolder-in-directory-without-parent-directory
- run: (cd package && zip -r "$OLDPWD/module.zip" .)

- 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: './src/module.json, ./module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# Create a release for this specific version
# - name: Update Release with Files
# if: "!github.event.release.prerelease"
# 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 }}

# OR create a pre-release for this specific version
# - name: Update Release with Files
# if: "github.event.release.prerelease"
# id: create_version_prerelease
# 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: true
# token: ${{ secrets.GITHUB_TOKEN }}
# artifacts: './module.json, ./module.zip'
# tag: ${{ github.event.release.tag_name }}
# body: ${{ github.event.release.body }}

#update next branch
# - name: Prepare repository
# if: "github.event.release.prerelease"
# run: |
# git config --global user.name '${{github.actor}}'
# git config --global user.email '${{github.actor}}@users.noreply.github.com'
# git add module.json
# git stash
# git clean -f
# git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
# git fetch origin "next"
# git switch -c "next" "origin/next"
# git checkout stash module.json
# git commit -m "${{github.event.release.tag_name}} manifest"
# git push -f
82 changes: 0 additions & 82 deletions .github/workflows/release.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file deleted? It's required in order to push the package release to Foundry's module registry.

This file was deleted.

Loading