-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# SPDX-FileCopyrightText: 2021 Johannes Loher | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
env: | ||
node_version: 16 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.node_version }} | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v3 | ||
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@v4 | ||
|
||
- name: Install node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.node_version }} | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v3 | ||
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 | ||
env: | ||
NODE_ENV: production | ||
|
||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
reuse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: REUSE Compliance Check | ||
uses: fsfe/reuse-action@v2 | ||
|
||
publish: | ||
needs: | ||
- lint | ||
- build | ||
- reuse | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.node_version }} | ||
|
||
- name: Download production artifacts for publication | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: Create zip file | ||
working-directory: ./dist | ||
run: zip -r ../module.zip . | ||
|
||
- name: Extract version | ||
run: | | ||
echo "::set-output name=version::$(jq -r '.version' package.json)" | ||
id: extract_version | ||
|
||
- name: Create release | ||
id: create_version_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: false | ||
name: ${{ steps.extract_version.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: "./module.json, ./module.zip" | ||
|
||
- name: Publish to Foundry Admin | ||
uses: Varriount/[email protected] | ||
with: | ||
username: ${{ secrets.FVTT_USERNAME }} | ||
password: ${{ secrets.FVTT_PASSWORD }} | ||
module-id: ${{ secrets.FVTT_PACKAGE_ID }} | ||
manifest-url: https://github.com/${{ github.repository }}/releases/download/v${{ steps.extract_version.outputs.version }}/module.json | ||
manifest-file: ./module.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters