Added Whitebrim taxi unlock #33
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: Publish path data bundle | |
| # Publishes the quest/gathering path data as a standalone, downloadable bundle whenever | |
| # path JSON changes. This is independent of the plugin release (release.yml) and does NOT | |
| # bump Directory.Build.targets or create a v{VERSION} tag. | |
| on: | |
| push: | |
| branches: [ new-main, testing ] | |
| paths: | |
| - 'QuestPaths/**' | |
| - 'GatheringPaths/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish-paths: | |
| runs-on: ubuntu-latest | |
| if: contains(fromJson(vars.RELEASE_USERNAMES), github.actor) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine channel | |
| id: channel | |
| run: | | |
| BRANCH=${GITHUB_REF#refs/heads/} | |
| if [ "$BRANCH" = "new-main" ]; then | |
| echo "channel=latest" >> $GITHUB_OUTPUT | |
| else | |
| echo "channel=testing" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Compute data version and format | |
| id: meta | |
| run: | | |
| # dataVersion = commit timestamp: monotonic, deterministic, tied to the path change. | |
| DATA_VERSION=$(git log -1 --format=%ct) | |
| # minPluginDataFormat = the format version this path snapshot was authored against. | |
| MIN_FORMAT=$(grep -oP 'CurrentVersion\s*=\s*\K[0-9]+' Questionable.Model/PathDataFormat.cs | head -1) | |
| if [ -z "$DATA_VERSION" ] || [ -z "$MIN_FORMAT" ]; then | |
| echo "Error: could not compute data version / plugin data format" | |
| exit 1 | |
| fi | |
| echo "data_version=$DATA_VERSION" >> $GITHUB_OUTPUT | |
| echo "min_format=$MIN_FORMAT" >> $GITHUB_OUTPUT | |
| echo "Data version: $DATA_VERSION, minimum plugin data format: $MIN_FORMAT" | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Validate quest JSON against the schema | |
| run: dotnet test QuestPaths.JsonValidator/QuestPaths.JsonValidator.csproj -c Release | |
| - name: Build bundle | |
| id: bundle | |
| run: | | |
| mkdir -p out | |
| GENERATED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| CHANNEL=${{ steps.channel.outputs.channel }} | |
| # manifest.json stored INSIDE the bundle — used by the plugin at load time for the | |
| # compatibility check; no url/sha needed since you already have the zip. | |
| cat > manifest.json <<EOF | |
| { | |
| "schemaVersion": 1, | |
| "dataVersion": ${{ steps.meta.outputs.data_version }}, | |
| "minPluginDataFormat": ${{ steps.meta.outputs.min_format }}, | |
| "maxPluginDataFormat": null, | |
| "generatedAt": "$GENERATED_AT" | |
| } | |
| EOF | |
| # Bundle = the expansion folders of both path projects + the manifest at the root. | |
| zip -r -q -X out/paths.zip QuestPaths/?.x* GatheringPaths/?.x* | |
| zip -q -X -j out/paths.zip manifest.json | |
| SHA=$(sha256sum out/paths.zip | cut -d' ' -f1) | |
| BUNDLE_URL="https://github.com/${{ github.repository }}/releases/download/paths-${CHANNEL}/paths.zip" | |
| # Standalone manifest published next to the bundle — the updater fetches this first | |
| # (cheap) to decide whether a newer, compatible bundle is available. | |
| cat > out/manifest-${CHANNEL}.json <<EOF | |
| { | |
| "schemaVersion": 1, | |
| "dataVersion": ${{ steps.meta.outputs.data_version }}, | |
| "minPluginDataFormat": ${{ steps.meta.outputs.min_format }}, | |
| "maxPluginDataFormat": null, | |
| "bundleUrl": "$BUNDLE_URL", | |
| "bundleSha256": "$SHA", | |
| "generatedAt": "$GENERATED_AT" | |
| } | |
| EOF | |
| echo "Bundle SHA-256: $SHA" | |
| ls -la out/ | |
| - name: Publish path bundle release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: paths-${{ steps.channel.outputs.channel }} | |
| name: "Path data (${{ steps.channel.outputs.channel }})" | |
| body: | | |
| Rolling quest/gathering path data bundle for the **${{ steps.channel.outputs.channel }}** channel. | |
| - Data version: `${{ steps.meta.outputs.data_version }}` | |
| - Minimum plugin data format: `${{ steps.meta.outputs.min_format }}` | |
| Updated automatically when path data changes. This does not trigger a plugin release. | |
| files: | | |
| out/paths.zip | |
| out/manifest-${{ steps.channel.outputs.channel }}.json | |
| draft: false | |
| prerelease: ${{ steps.channel.outputs.channel == 'testing' }} | |
| make_latest: false | |
| - name: Collect changed path files | |
| id: changes | |
| run: | | |
| # List files changed in this push that live under QuestPaths/ or GatheringPaths/. | |
| # For a normal push, github.event.before points at the previous tip; for the first | |
| # push to a branch (or workflow_dispatch) it can be all-zeros, so fall back to HEAD~1. | |
| BEFORE="${{ github.event.before }}" | |
| if [ -z "$BEFORE" ] || [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then | |
| BEFORE=$(git rev-parse HEAD~1 2>/dev/null || echo "") | |
| fi | |
| if [ -n "$BEFORE" ]; then | |
| NUMSTAT=$(git diff --numstat "$BEFORE" HEAD -- 'QuestPaths/**' 'GatheringPaths/**') | |
| else | |
| NUMSTAT=$(git diff-tree --no-commit-id --numstat -r HEAD -- 'QuestPaths/**' 'GatheringPaths/**') | |
| fi | |
| # Drop files whose diff is exactly one line added and one line removed — these are | |
| # almost always automated "last checked" date bumps and not interesting changes. | |
| FILES=$(printf '%s\n' "$NUMSTAT" | awk '$1 != "1"|| $2 != "1" { $1=$2=""; print substr($0,3) }') | |
| # Cap the list so the Discord message stays under the 2000-char limit. | |
| MAX=5 | |
| TOTAL=$(printf '%s\n' "$NUMSTAT" | sed '/^$/d' | wc -l) | |
| BULLETS=$(printf '%s\n' "$FILES" | sed '/^$/d' | head -n $MAX | sed 's|.*/||; s|^|- |') | |
| if [ "$TOTAL" -gt "$MAX" ]; then | |
| REMAINING=$((TOTAL - MAX)) | |
| BULLETS="${BULLETS}"$'\n'"- …and ${REMAINING} more" | |
| fi | |
| { | |
| echo "files<<CHANGED_EOF" | |
| echo "$BULLETS" | |
| echo "CHANGED_EOF" | |
| } >> $GITHUB_OUTPUT | |
| echo "Changed path files ($TOTAL):" | |
| echo "$BULLETS" | |
| - name: Github Releases To Discord | |
| if: steps.channel.outputs.channel == 'latest' | |
| uses: cstuder/apprise-ga@master | |
| env: | |
| APPRISE_URL: "${{ secrets.APPRISE_URL }}&url=https://github.com/PunishXIV/Questionable/releases/tag/paths-${{ steps.channel.outputs.channel }}" | |
| with: | |
| title: Questionable Paths v${{ steps.meta.outputs.data_version }} | |
| message: | | |
| New path data bundle has been released. This will be automatically downloaded by the plugin, or you can click "Check for path updates now" in Settings>Advanced. | |
| Changed files: | |
| ${{ steps.changes.outputs.files }} |