Merge pull request #242 from deltagreen-foundryvtt/jalenml/more-github-integrations
Jalenml/more GitHub integrations
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: RFC (Request for comment)
|
||||
about: Propose a larger-scope change for discussion and approval
|
||||
title: "RFC: Short & descriptive title"
|
||||
labels: request for comment
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
<!-- One or two sentences describing the proposal. -->
|
||||
|
||||
## Motivation
|
||||
|
||||
<!-- Why should this be done? What problem does it solve? -->
|
||||
|
||||
## Proposed solution
|
||||
|
||||
<!-- High-level approach; include screenshots or links if available. -->
|
||||
|
||||
## Impact
|
||||
|
||||
- [ ] Would include breaking changes
|
||||
- Affected areas:
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Tech debt
|
||||
about: Track refactors or maintenance tasks. Typically for devs only.
|
||||
title: Short & descriptive title
|
||||
labels: tech debt
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## What is the debt?
|
||||
|
||||
<!-- Briefly describe the problem and where it lives. -->
|
||||
|
||||
## Why fix it?
|
||||
|
||||
<!-- Impact if left as-is; benefits of fixing. -->
|
||||
|
||||
## Proposed change
|
||||
|
||||
<!-- One or two sentences or a link to a plan/PR. -->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] No unexpected user-visible changes (or note them)
|
||||
- [ ] Tests/docs updated if needed
|
||||
@@ -0,0 +1,11 @@
|
||||
name: "Build Compendium Packs"
|
||||
description: "Builds the compendium pack binaries from source JSON files"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Node Setup
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Build Compendium Packs
|
||||
run: ./build/build-packs.sh
|
||||
shell: bash
|
||||
@@ -1,65 +0,0 @@
|
||||
# This is a basic workflow that is manually triggered
|
||||
name: Build Packs
|
||||
|
||||
# Controls when the action will run. Workflow runs when release is published.
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called buildPacks
|
||||
buildPacks:
|
||||
# The type of runner that the job will run on. This must be ubuntu for the zip command to work.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Each step runs a single command using the runners shell.
|
||||
# 1. Checkout our repository so we can do things on it.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
# 2. Make sure node is set up. This may be an unecessary step.
|
||||
- name: Node Setup
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
# 3. Install the FoundryVTT CLI.
|
||||
- run: npm install -g @foundryvtt/foundryvtt-cli
|
||||
# 4. Configure the datapath as the github workspace variable.
|
||||
- run: fvtt configure set "dataPath" ${GITHUB_WORKSPACE}
|
||||
# 5. Tell the FVTT CLI that we are working on a "system" package.
|
||||
- run: fvtt package workon fvtt package workon "deltagreen" --type "System"
|
||||
# 6-11. Package each folder of source json files into the appropriate LevelDB pack.
|
||||
- run: fvtt package pack "armor" --in "packs/source/armor" --out "packs"
|
||||
- run: fvtt package pack "firearms" --in "packs/source/firearms" --out "packs"
|
||||
- run: fvtt package pack "hand-to-hand-weapons" --in "packs/source/hand-to-hand-weapons" --out "packs"
|
||||
- run: fvtt package pack "operation-code-name-generator" --in "packs/source/operation-code-name-generator" --out "packs"
|
||||
- run: fvtt package pack "operation-code-name-generator-macro" --in "packs/source/operation-code-name-generator-macro" --out "packs"
|
||||
- run: fvtt package pack "pregens" --in "packs/source/pregens" --out "packs"
|
||||
# 12. Get the version number without the leading -v.
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
uses: dhkatz/get-version-action@v3.0.0
|
||||
# 13. Substitute the Manifest and Download URLs in the system.json
|
||||
- name: Substitute Manifest, Download Links For Versioned Ones
|
||||
uses: TomaszKandula/variable-substitution@v1.0.1
|
||||
with:
|
||||
files: "system.json"
|
||||
env:
|
||||
version: ${{steps.get_version.outputs.version-without-v}}
|
||||
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/deltagreen.zip
|
||||
# 14. Zip up the branch with the LevelDB packs.
|
||||
- name: Zip
|
||||
# Exclude the source json files from the final package, as well as any git folders.
|
||||
run: zip -r deltagreen.zip . --exclude="*packs/source/*" --exclude=".*" --exclude="package-lock.json" --exclude="package.json"
|
||||
# 15. Updates the release with the newly zipped branch. See documentation of this action for details.
|
||||
- name: Update Release with Artifacts
|
||||
uses: ncipollo/release-action@v1.13.0
|
||||
with:
|
||||
allowUpdates: true
|
||||
name: ${{ github.event.release.name }}
|
||||
tag: ${{ github.event.release.tag_name }}
|
||||
body: ${{ github.event.release.body }}
|
||||
artifacts: "./deltagreen.zip, ./system.json"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,62 @@
|
||||
name: Dev Build (GitHub Pages)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [$default-branch]
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Packs
|
||||
uses: ./.github/actions/build-packs
|
||||
|
||||
- name: Substitute Download Link
|
||||
uses: TomaszKandula/variable-substitution@v1.0.1
|
||||
with:
|
||||
files: "system.json"
|
||||
env:
|
||||
download: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev/deltagreen.zip
|
||||
|
||||
- name: Copy system.json
|
||||
run: mkdir dist && cp system.json dist/dev-system.json
|
||||
|
||||
- name: Zip
|
||||
run: |
|
||||
zip -r dist/deltagreen.zip . \
|
||||
-x "packs/source/*" \
|
||||
-x "build/*" \
|
||||
-x ".*" \
|
||||
-x "package.json" \
|
||||
-x "package-lock.json" \
|
||||
-x "node_modules/*"
|
||||
|
||||
# Deploy to GitHub Pages (see https://github.com/actions/starter-workflows/blob/main/pages/static.yml)
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: "dist"
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -0,0 +1,62 @@
|
||||
# This is a basic workflow that is manually triggered
|
||||
name: Release
|
||||
|
||||
# Controls when the action will run. Workflow runs when release is published.
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called buildPacks
|
||||
release:
|
||||
# The type of runner that the job will run on. This must be ubuntu for the zip command to work.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Packs
|
||||
uses: ./.github/actions/build-packs
|
||||
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
uses: dhkatz/get-version-action@v3.0.0
|
||||
|
||||
- name: Substitute Manifest, Download Links For Versioned Ones
|
||||
uses: TomaszKandula/variable-substitution@v1.0.1
|
||||
with:
|
||||
files: "system.json"
|
||||
env:
|
||||
flags: ""
|
||||
version: ${{steps.get_version.outputs.version-without-v}}
|
||||
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/deltagreen.zip
|
||||
|
||||
- name: Zip
|
||||
run: |
|
||||
zip -r deltagreen.zip . \
|
||||
-x "packs/source/*" \
|
||||
-x "build/*" \
|
||||
-x ".*" \
|
||||
-x "package.json" \
|
||||
-x "package-lock.json" \
|
||||
-x "node_modules/*"
|
||||
|
||||
- name: Update Release with Artifacts
|
||||
uses: ncipollo/release-action@v1.13.0
|
||||
with:
|
||||
allowUpdates: true
|
||||
name: ${{ github.event.release.name }}
|
||||
tag: ${{ github.event.release.tag_name }}
|
||||
body: ${{ github.event.release.body }}
|
||||
artifacts: "./deltagreen.zip, ./system.json"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
npx --no-install fvtt package workon "deltagreen" --type "System"
|
||||
|
||||
for folder in packs/source/*; do
|
||||
name=$(basename $folder)
|
||||
npx --no-install fvtt package pack "$name" --in "$folder" --out "packs"
|
||||
done
|
||||
Reference in New Issue
Block a user