# Release an adaptation pack (packages/patcher/src/patch-pack/): pack and sign patches/ and publish # it as a GitHub release tagged patches-, where the launcher looks for it. # # Start it either way: # - push a tag: git tag patches-2026.11.29 && git push origin patches-2026.11.29 # - from the Actions page (Run workflow), giving the version; the tag is created on the chosen # branch's latest commit. # The signing key comes from the repository secret PATCH_SIGNING_KEY # (scripts/generate-patch-signing-key.ts). name: Adaptation pack on: push: tags: ['patches-*'] workflow_dispatch: inputs: version: description: 'Pack version, YYYY.MM.DD or YYYY.MM.DD.N' required: true type: string permissions: contents: write jobs: release: runs-on: ubuntu-latest env: # Packing needs no Electron binary. ELECTRON_SKIP_BINARY_DOWNLOAD: '1' VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 24 cache: npm - run: npm ci - name: Pack and sign env: PATCH_SIGNING_KEY: ${{ secrets.PATCH_SIGNING_KEY }} run: | if [ -n "$VERSION" ]; then node scripts/build-patch-pack.ts --version "$VERSION" --out dist else # The version comes from the pushed tag (GITHUB_REF_NAME). node scripts/build-patch-pack.ts --out dist fi - name: Publish the release env: GH_TOKEN: ${{ github.token }} run: | manifest=$(ls dist/*.manifest.json) field() { node -e "const m=JSON.parse(require('fs').readFileSync(process.argv[1],'utf8'));const v=m[process.argv[2]];process.stdout.write(Array.isArray(v)?v.join(', '):String(v))" "$manifest" "$1"; } version=$(field version) printf 'Adaptation pack %s.\n\nChecked game versions: %s\nNeeds offline version %s or newer.\n' \ "$version" "$(field game_versions)" "$(field min_app_version)" > dist/notes.md gh release create "patches-$version" \ "dist/wtoffline-patches-$version.zip" \ "dist/wtoffline-patches-$version.zip.sig" \ "dist/wtoffline-patches-$version.manifest.json" \ --title "Adaptation pack $version" \ --notes-file dist/notes.md \ --target "$GITHUB_SHA"