mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
Fix release workflow gaps blocking first macOS beta
- Appcast publish: fetch gh-pages into a local branch before creating the worktree. actions/checkout's narrow refspec meant the branch was checked out detached, so `git push origin gh-pages` failed with "src refspec gh-pages does not match any" on a fresh runner. - Gate the AltStore source update on an iOS build being part of the release; a mac/tvOS-only release has no IPA and would publish a broken entry. - Pass the release tag to update-altstore explicitly (gh's "latest release" excludes prereleases), parse the build number correctly for beta tags (2.0.0-beta.263 -> 263, not beta.263), use the real Yattee-<version>-iOS.ipa asset name, and fail instead of writing a size-0 entry with a dead URL when the IPA asset is missing.
This commit is contained in:
34
.github/workflows/update-altstore.yml
vendored
34
.github/workflows/update-altstore.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Update AltStore source
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to publish (defaults to the latest release)'
|
||||
type: string
|
||||
required: false
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
type: string
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
update_altstore:
|
||||
@@ -13,18 +22,29 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
- name: Get version info from latest release
|
||||
- name: Get version info from release
|
||||
run: |
|
||||
TAG=$(gh release view --json tagName --jq '.tagName')
|
||||
TAG="${{ inputs.tag }}"
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=$(gh release view --json tagName --jq '.tagName')
|
||||
fi
|
||||
# Tags are <version>-<build> (stable) or <version>-beta.<build> (beta),
|
||||
# e.g. 2.0.0-263 or 2.0.0-beta.263.
|
||||
echo "TAG=${TAG}" >> $GITHUB_ENV
|
||||
echo "VERSION_NUMBER=${TAG%-*}" >> $GITHUB_ENV
|
||||
echo "BUILD_NUMBER=${TAG##*-}" >> $GITHUB_ENV
|
||||
echo "VERSION_NUMBER=${TAG%%-*}" >> $GITHUB_ENV
|
||||
echo "BUILD_NUMBER=${TAG##*[-.]}" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get IPA size from release
|
||||
run: |
|
||||
SIZE=$(gh release view "${{ env.TAG }}" --json assets --jq '.assets[] | select(.name == "Yattee.ipa") | .size')
|
||||
echo "IPA_SIZE=${SIZE:-0}" >> $GITHUB_ENV
|
||||
IPA_NAME="Yattee-${{ env.VERSION_NUMBER }}-iOS.ipa"
|
||||
SIZE=$(gh release view "${{ env.TAG }}" --json assets --jq ".assets[] | select(.name == \"$IPA_NAME\") | .size")
|
||||
if [ -z "$SIZE" ]; then
|
||||
echo "::error::Release ${{ env.TAG }} has no asset named $IPA_NAME — refusing to publish a broken AltStore entry"
|
||||
exit 1
|
||||
fi
|
||||
echo "IPA_NAME=${IPA_NAME}" >> $GITHUB_ENV
|
||||
echo "IPA_SIZE=${SIZE}" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Update altstore-source.json
|
||||
@@ -33,7 +53,7 @@ jobs:
|
||||
jq --arg version "${{ env.VERSION_NUMBER }}" \
|
||||
--arg build "${{ env.BUILD_NUMBER }}" \
|
||||
--arg date "$DATE" \
|
||||
--arg url "https://github.com/yattee/yattee/releases/download/${{ env.TAG }}/Yattee.ipa" \
|
||||
--arg url "https://github.com/yattee/yattee/releases/download/${{ env.TAG }}/${{ env.IPA_NAME }}" \
|
||||
--argjson size "${{ env.IPA_SIZE }}" \
|
||||
'.apps[0].versions = [{
|
||||
version: $version,
|
||||
|
||||
Reference in New Issue
Block a user