Add hotfix-dev release to github action workflow

This commit is contained in:
jalensailin
2025-12-12 03:04:10 -05:00
parent 34bd2b5398
commit ee9d9a179b
5 changed files with 59 additions and 33 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
name: "Build Compendium Packs"
description: "Builds the compendium pack binaries from source JSON files"
runs:
using: "composite"
steps:
@@ -7,5 +8,5 @@ runs:
uses: ./.github/actions/setup-node
- name: Build Compendium Packs
run: ./build/build-packs.sh
shell: bash
run: ./build/build-packs.sh
+2 -1
View File
@@ -1,5 +1,6 @@
name: "Setup Node Project"
description: "Sets up a Node.js project"
runs:
using: "composite"
steps:
@@ -10,5 +11,5 @@ runs:
cache: npm
- name: Install dependencies
run: npm ci
shell: bash
run: npm ci
+3 -12
View File
@@ -1,27 +1,18 @@
name: "Zip Project"
description: "Zips the project for distribution"
inputs:
path:
description: "Path to output directory for zip file"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Zip
shell: bash
run: |
if [[ -z "${{ inputs.path }}" ]]; then
OUTPUT_PATH="deltagreen.zip"
else
OUTPUT_PATH="${{ inputs.path }}/deltagreen.zip"
fi
zip -r "${OUTPUT_PATH}" . \
zip -r deltagreen.zip . \
-x "packs/source/*" \
-x "build/*" \
-x "dist/*" \
-x ".*" \
-x "package.json" \
-x "package-lock.json" \
-x "node_modules/*"
-x "node_modules/*" \
-x "site/*"
+50 -18
View File
@@ -1,19 +1,15 @@
name: Dev Build (GitHub Pages)
on:
push:
branches:
- master
- hotfix/**
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
@@ -23,37 +19,73 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
# -------------------------------
# 1. Checkout SOURCE code
# -------------------------------
- name: Checkout source repo
uses: actions/checkout@v4
# -------------------------------
# 2. Create useful variables/output.
# -------------------------------
- name: Compute branch folder
id: vars
shell: bash
run: |
BRANCH="${GITHUB_REF#refs/heads/}"
if [[ "$BRANCH" == "master" ]]; then
TARGET="dev"
NON_TARGET="hotfix"
else
TARGET="hotfix"
NON_TARGET="dev"
fi
echo "target=$TARGET" >> $GITHUB_OUTPUT
echo "non_target=$NON_TARGET" >> $GITHUB_OUTPUT
# -------------------------------
# 3. Build and Zip the system
# -------------------------------
- name: Build Packs
uses: ./.github/actions/build-packs
- name: Substitute Download Link
uses: TomaszKandula/variable-substitution@v1.0.1
with:
files: "system.json"
files: system.json
env:
version: dev
download: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev/deltagreen.zip
- name: Copy system.json
run: mkdir -p dist/dev && cp system.json dist/dev/dev-system.json
version: ${{ steps.vars.outputs.target }}
download: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.vars.outputs.target }}/deltagreen.zip
- name: Zip
uses: ./.github/actions/zip-system
with:
path: "dist/dev"
# Deploy to GitHub Pages (see https://github.com/actions/starter-workflows/blob/main/pages/static.yml)
# -------------------------------
# 4. Deploy to Github Pages
# -------------------------------
- name: Create Site Structure
shell: bash
run: |
# Create site directories.
mkdir -p site/dev site/hotfix
# Download files from non-target build.
URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.vars.outputs.non_target }}"
wget -O site/${{ steps.vars.outputs.non_target }}/deltagreen.zip "$URL"/deltagreen.zip
wget -O site/${{ steps.vars.outputs.non_target }}/system.json "$URL"/system.json
# Copy files from current build.
cp system.json deltagreen.zip site/${{ steps.vars.outputs.target }}/
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "dist"
path: site
- name: Deploy to GitHub Pages
id: deployment
- name: Deploy
uses: actions/deploy-pages@v4
+2 -1
View File
@@ -222,7 +222,8 @@ It is difficult to create a one-size-fits-all procedure for testing, because eac
- If you do not follow the above advice, be aware that opening your main world while you have an in-progress (non-release) version of the system installed **will almost certainly break things in a way that cannot be fixed**. To go back to the release version of the system, uninstall the test build, and reinstall from the in-Foundry system browser.
- Update to the target build:
- Development setup: `git checkout` the target branch (or `master` for merged work), then restart Foundry.
- No dev setup: Install or update the system from the dev manifest: <https://deltagreen-foundryvtt.github.io/delta-green-foundry-vtt-system/dev/dev-system.json>
- No dev setup: Install or update the system from the dev manifest: <https://deltagreen-foundryvtt.github.io/delta-green-foundry-vtt-system/dev/system.json>
- **Note**: Testing a **hotfix** branch? Use the hotfix manifest instead: <https://deltagreen-foundryvtt.github.io/delta-green-foundry-vtt-system/hotfix/system.json>
- Use a clean test world:
- Create a fresh world
- Note, this is a good practice, but is not always strictly necessary. If you run into anything weird, a completely fresh world is always a good rule-out test.