Skip to content

Main

Main #8316

Workflow file for this run

name: Main
on: workflow_dispatch
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
run_install: false
- name: Checkout
uses: actions/checkout@v4
with:
path: main
- name: Get pnpm Store Directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm Deps
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('main/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
- name: Install pnpm Deps
working-directory: ./main
run: pnpm install
- name: FVTTPF2E - Checkout
uses: actions/checkout@v4
with:
repository: foundryvtt/pf2e
ref: v13-dev
path: system
- name: FVTTPF2E - Cache NPM Deps
id: cache-npm
uses: actions/cache@v4
with:
path: system/node_modules/
key: npm-${{ hashFiles('system/package-lock.json') }}
- name: FVTTPF2E - Install NPM Deps
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
working-directory: ./system
run: npm ci
- name: FVTTPF2E - Cache Packs
id: cache-packs
uses: actions/cache@v4
with:
path: system/static/packs/
key: pf-packs-${{ hashFiles('system/packs/**/*') }}
- name: FVTTPF2E - Build Packs
if: ${{ steps.cache-packs.outputs.cache-hit != 'true' }}
working-directory: ./system
run: |
npm run clean
npm run build:packs:json
- name: FVTTPF2E - Get System Version
working-directory: ./system
run: |
SYSTEM_VERSION=$(grep -oP '(?<="version": ")[^"]+' static/system.json | tr -d '\n')
echo "systemVersion=$SYSTEM_VERSION" >> $GITHUB_ENV
- name: Build
working-directory: ./main
run: pnpm run exec update
- name: Update Version
working-directory: ./main
run: echo "${{ env.systemVersion }}" > version.txt
- name: Get Commit Hash
working-directory: ./system
run: echo "SYSTEM_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Update Repo
working-directory: ./main
run: |
git config user.name github-actions
git config user.email [email protected]
git add lang version.txt
git diff --quiet HEAD || git commit -am "Updated to foundryvtt/pf2e@${{ env.SYSTEM_HASH }}"
git push