mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
fix(ci): use triggering tag + sha for flatpak manifest patch (#295)
The \`app-v*\` tag referenced by the manifest only becomes a real git ref when the Draft release is published, so the previous \`git ls-remote\` lookup during CI always returned empty and flatpak-builder failed with "unknown revision app-v<version>". Use \`github.ref_name\` and \`github.sha\` directly — both exist when the workflow fires. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
2476c2197d
commit
908c7ceebb
@@ -268,19 +268,16 @@ jobs:
|
||||
-o packages/flatpak/npm-sources.json
|
||||
|
||||
- name: patch manifest for this release
|
||||
# The `app-v*` tag only materialises when the Draft release is published,
|
||||
# so it is not a real git ref during CI. Use the triggering `v*` tag
|
||||
# and its commit sha directly — both exist when the workflow runs.
|
||||
env:
|
||||
VERSION: ${{ needs.create-release.outputs.package_version }}
|
||||
TRIGGER_TAG: ${{ github.ref_name }}
|
||||
TRIGGER_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
git config --global --add safe.directory /__w/psysonic/psysonic
|
||||
# Dereference the release tag to get the commit it points to.
|
||||
# ^{} peels annotated tag objects; falls back for lightweight tags.
|
||||
COMMIT=$(git ls-remote origin "refs/tags/app-v${VERSION}^{}" | awk '{print $1}')
|
||||
if [ -z "$COMMIT" ]; then
|
||||
COMMIT=$(git ls-remote origin "refs/tags/app-v${VERSION}" | awk '{print $1}')
|
||||
fi
|
||||
sed -i \
|
||||
-e "s|tag: app-v.*|tag: app-v${VERSION}|" \
|
||||
-e "s|commit: PLACEHOLDER_COMMIT|commit: ${COMMIT}|" \
|
||||
-e "s|tag: app-v.*|tag: ${TRIGGER_TAG}|" \
|
||||
-e "s|commit: PLACEHOLDER_COMMIT|commit: ${TRIGGER_SHA}|" \
|
||||
-e "s|VITE_LASTFM_API_KEY=__LASTFM_KEY__|VITE_LASTFM_API_KEY=${{ secrets.VITE_LASTFM_API_KEY }}|" \
|
||||
-e "s|VITE_LASTFM_API_SECRET=__LASTFM_SECRET__|VITE_LASTFM_API_SECRET=${{ secrets.VITE_LASTFM_API_SECRET }}|" \
|
||||
packages/flatpak/dev.psysonic.Psysonic.yml
|
||||
|
||||
Reference in New Issue
Block a user