mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Fix GIT_COMMIT_HASH not set in Flatpak builds (#12725)
The env var check was gated inside the .git directory check, so Flatpak builds (which exclude .git from the sandbox) always fell back to "0000000". Lift the env var check to top level and inject the commit hash into the Flatpak manifest via build-options.env.
This commit is contained in:
7
.github/workflows/build_all.yml
vendored
7
.github/workflows/build_all.yml
vendored
@@ -170,7 +170,7 @@ jobs:
|
||||
git_commit_hash="${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
git_commit_hash=""
|
||||
git_commit_hash="${{ github.sha }}"
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
@@ -197,6 +197,11 @@ jobs:
|
||||
sed -i '0,/^finish-args:/s//build-options:\n no-debuginfo: true\n strip: true\nfinish-args:/' \
|
||||
scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- name: Inject git commit hash into Flatpak manifest
|
||||
run: |
|
||||
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \
|
||||
scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
||||
with:
|
||||
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
|
||||
Reference in New Issue
Block a user