Merge branch 'main' of github.com:ForgeVTT/test-foundry-modules #18
This file contains hidden or 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
| name: Build package versions | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: build-zips-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| VERSION_V0: "0.0.3" | |
| VERSION_V1: "1.0.2" | |
| VERSION_V2: "2.0.1" | |
| jobs: | |
| build: | |
| name: 📦 Build package versions | |
| runs-on: ubuntu-latest | |
| if: github.actor != 'github-actions[bot]' | |
| steps: | |
| - name: ⬇️ Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🔧 Make package script executable | |
| run: chmod +x .github/scripts/packages.sh | |
| - name: 🧩 Create versioned copies | |
| shell: bash | |
| run: .github/scripts/packages.sh create-versioned-copies | |
| - name: 📦 Build main package ZIPs | |
| shell: bash | |
| run: .github/scripts/packages.sh build-main-zips | |
| - name: 🗂️ Build version ZIPs | |
| shell: bash | |
| run: .github/scripts/packages.sh build-version-zips | |
| - name: ✅ Commit & push changes (if any) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git status --porcelain | |
| if git status --porcelain | grep .; then | |
| echo "Changes detected, committing..." | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| if git diff --cached --quiet; then | |
| echo "No relevant changes to commit after add." | |
| exit 0 | |
| fi | |
| git commit -m "chore: Update packages and versioned copies (automated)" | |
| git push --force-with-lease | |
| else | |
| echo "No changes to commit." | |
| fi |