build(release)!: move publishing to Gitea and R2
Prepare signed Gitea releases with the VPS entry point and protect versioned R2 assets from replacement. Use the R2 release feed as the default update source. Verified both type checks and the VPS and R2 release commands in help mode. BREAKING CHANGE: The GitHub Actions release workflows have been removed. Run scripts/release-vps.ts from a checkout of the release tag on Gitea.
This commit is contained in:
1 parent
d58ba9fb9b
commit
894dd0363d
8 files changed
+391
-189
No files matched your search
@@ -1,97 +0,0 @@
|
||||
# Build, sign, and publish a Windows installer of the WTOffline Launcher as a GitHub release
|
||||
# tagged v<version>. The launcher's update check reads v<version> releases and expects the three
|
||||
# signed files (installer, manifest, signature); a release missing any of them breaks the check
|
||||
# for already-installed launchers. The workflow also packages and signs the portable zip with its
|
||||
# own manifest and signature so portable installations can update in place.
|
||||
#
|
||||
# Start it either way:
|
||||
# - push a tag: git tag v0.1.0 && git push origin v0.1.0
|
||||
# - from the Actions page (Run workflow), giving the version; the tag is created on the chosen
|
||||
# branch's latest commit.
|
||||
# The release note comes from .github/release-notes/v<version>.md. The signing key comes from the
|
||||
# repository secret PATCH_SIGNING_KEY (the same Ed25519 key used for adaptation packs).
|
||||
name: Launcher release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Launcher version, e.g. 0.1.0 (must match apps/launcher/package.json)'
|
||||
required: true
|
||||
type: string
|
||||
draft:
|
||||
description: 'Keep the release as a draft for editing before publication'
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download the Electron runtime
|
||||
run: node node_modules/electron/install.js
|
||||
|
||||
- name: Resolve and verify the version
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = 'workflow_dispatch' ]; then
|
||||
VERSION="${{ inputs.version }}"
|
||||
else
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
fi
|
||||
PKG_VERSION=$(node -p "require('./apps/launcher/package.json').version")
|
||||
if [ "$VERSION" != "$PKG_VERSION" ]; then
|
||||
echo "Version $VERSION does not match apps/launcher/package.json ($PKG_VERSION)" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Typecheck
|
||||
run: |
|
||||
npm run typecheck
|
||||
npm run typecheck --workspace "@wto/launcher"
|
||||
|
||||
- name: Build and package the Windows installer and portable archive
|
||||
run: npm --workspace "@wto/launcher" run package:win
|
||||
|
||||
- name: Sign the release
|
||||
env:
|
||||
PATCH_SIGNING_KEY: ${{ secrets.PATCH_SIGNING_KEY }}
|
||||
run: node scripts/sign-launcher-release.ts
|
||||
|
||||
- name: Create the release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
flags=(--draft)
|
||||
if [ "${{ github.event_name }}" = 'workflow_dispatch' ] && [ "${{ inputs.draft }}" = 'false' ]; then
|
||||
flags=()
|
||||
fi
|
||||
gh release create "v$VERSION" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64.exe" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64.manifest.json" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64.manifest.json.sig" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64-portable.zip" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64-portable.manifest.json" \
|
||||
"build/windows-installer/wtoffline-launcher-$VERSION-win-x64-portable.manifest.json.sig" \
|
||||
"${flags[@]}" \
|
||||
--title "WTOffline Launcher $VERSION" \
|
||||
--notes-file ".github/release-notes/v$VERSION.md" \
|
||||
--target "$GITHUB_SHA"
|
||||
@@ -1,78 +0,0 @@
|
||||
# Release an adaptation pack (packages/patcher/src/patch-pack/): pack and sign patches/ and publish
|
||||
# it as a GitHub prerelease tagged patches-<version>, 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
|
||||
draft:
|
||||
description: 'Keep the signed prerelease as a draft for editing before publication'
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
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: Create the prerelease
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
DRAFT: ${{ inputs.draft || false }}
|
||||
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
|
||||
release_flags=(--prerelease)
|
||||
if [ "$DRAFT" = 'true' ]; then
|
||||
release_flags+=(--draft)
|
||||
fi
|
||||
gh release create "patches-$version" \
|
||||
"dist/wtoffline-patches-$version.zip" \
|
||||
"dist/wtoffline-patches-$version.zip.sig" \
|
||||
"dist/wtoffline-patches-$version.manifest.json" \
|
||||
"${release_flags[@]}" \
|
||||
--title "Adaptation pack $version" \
|
||||
--notes-file dist/notes.md \
|
||||
--target "$GITHUB_SHA"
|
||||
Reference in new issue
Block a user