Skip to content

Commit

Permalink
finished migration to github
Browse files Browse the repository at this point in the history
  • Loading branch information
FloRad committed Feb 17, 2022
1 parent 60f7248 commit 5effb7c
Show file tree
Hide file tree
Showing 10 changed files with 939 additions and 1,514 deletions.
File renamed without changes.
61 changes: 61 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Checks

on:
- push
- pull_request

env:
node_version: 16

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline

- name: Lint
run: npm run lint

build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline

- name: Build
run: npm run build
112 changes: 112 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Release

on:
release:
types: [published]

env:
package_type: module
node_version: 16

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline

- name: Lint
run: npm run lint

build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline

- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2

- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'src/${{ env.package_type }}.json'
env:
version: ${{ steps.get_version.outputs.version-without-v }}
url: https://github.com/${{ github.repository }}
manifest: https://github.com/${{ github.repository }}/releases/latest/download/${{ env.package_type }}.json
download: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/${{ env.package_type }}.zip

- name: Build
run: npm run build

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

publish:
needs:
- lint
- build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download production artifacts for publication
uses: actions/download-artifact@v2
with:
name: dist
path: dist

- name: Create zip file
working-directory: ./dist
run: zip -r ../${{ env.package_type }}.zip .

- name: Create release
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ github.event.release.name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './dist/${{ env.package_type }}.json, ./${{ env.package_type }}.zip'
body: ${{ github.event.release.body }}
90 changes: 0 additions & 90 deletions .gitlab-ci.yml

This file was deleted.

File renamed without changes.
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,8 @@ you need to run the above command in an administrator terminal for it to work.

### Creating a release

In order to create a versioned release, simply create / push a new tag that follows the pattern
`v<number>.<number>.<number>`. This triggers a pipeline run that automatically builds the package and creates a release
that has a `module.zip` / `system.zip` and a `module.json` / `system.json` attached to it. These files are set up so
that they work in the same way as in the [League Basic JS Module Template], so you can follow the instructions given
there to list the release on the Foundry VTT package admin page.

If you want to provide release notes, you can then edit the created release to add a description.
The workflow works basically the same as the workflow of the [League Basic JS Module Template], please follow the
instructions given there.

## Licensing

Expand All @@ -93,8 +88,7 @@ This project is being developed under the terms of the

Repository content licensed under [Apache License 2.0]

[dame gm's blog post]: https://damegm.wordpress.com/2015/07/29/an-alternative-to-alignment/
[releases page]: https://gitlab.com/florad-foundry/moral-code/-/releases
[league basic js module template]: https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template
[limited license agreement for module development]: https://foundryvtt.com/article/license/
[apache license 2.0]: https://gitlab.com/florad-foundry/moral-code/-/blob/main/LICENSE
[Dame GM's Blog Post]: https://damegm.wordpress.com/2015/07/29/an-alternative-to-alignment/
[League Basic JS Module Template]: https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template
[LIMITED LICENSE AGREEMENT FOR MODULE DEVELOPMENT]: https://foundryvtt.com/article/license/
[Apache License 2.0]: https://gitlab.com/florad-foundry/moral-code/-/blob/main/LICENSE
Loading

0 comments on commit 5effb7c

Please sign in to comment.