Skip to content

Commit ad6ccb2

Browse files
committed
CI: Create new FontPatcher.zip only at the end of release workflow
[why] We have an obsolete glyhnames.json in the release FontPatcher.zip. [how] Packaging the FontPatcher.zip should be the last step when everything has already been updated. Some code from the zip-release.yml workflow is copied into the release.yml :-/ but we need to do it at the exact right time. Note that we need to commit-push before we call the github-pages-deploy-action. [note] Related: #1868 Reported-by: @subframe7536 Signed-off-by: Fini Jastrow <[email protected]>
1 parent fcaadca commit ad6ccb2

File tree

1 file changed

+42
-39
lines changed

1 file changed

+42
-39
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -242,41 +242,9 @@ jobs:
242242
patched-fonts/${{ matrix.font }}
243243
archives/SHA*
244244
245-
release-font-patcher:
246-
name: Archive font patcher and add to release
247-
needs: [ setup-fonts-matrix, build ]
248-
249-
env:
250-
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
251-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252-
RELEASE_VERSION: ${{ needs.setup-fonts-matrix.outputs.rel_version }}
253-
RELEASE_CANDIDATE: ${{ needs.setup-fonts-matrix.outputs.rel_candidate }}
254-
255-
runs-on: ubuntu-latest
256-
steps:
257-
- uses: actions/checkout@v4
258-
- name: Bump version for source files
259-
run: |
260-
cd -- "$GITHUB_WORKSPACE/bin/scripts"
261-
./version-bump.sh "$RELEASE_VERSION"
262-
263-
- name: Archive font-patcher script for release
264-
run: |
265-
cd -- "$GITHUB_WORKSPACE/bin/scripts"
266-
./archive-font-patcher.sh
267-
268-
- name: Upload font-patcher archive for release
269-
uses: softprops/action-gh-release@v2
270-
if: needs.setup-fonts-matrix.outputs.rel_upload == 'true'
271-
with:
272-
draft: true
273-
prerelease: ${{ env.RELEASE_CANDIDATE != 'false' }}
274-
tag_name: "v${{ env.RELEASE_VERSION }}"
275-
files: archives/*
276-
277245
commit:
278246
name: Commit and push patched fonts to the repo, finalize release
279-
needs: [ setup-fonts-matrix, build, release-font-patcher ]
247+
needs: [ setup-fonts-matrix, build ]
280248
env:
281249
RELEASE_VERSION: ${{ needs.setup-fonts-matrix.outputs.rel_version }}
282250
RELEASE_CANDIDATE: ${{ needs.setup-fonts-matrix.outputs.rel_candidate }}
@@ -373,6 +341,47 @@ jobs:
373341
committer_name: GitHub Actions
374342
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
375343

344+
- name: Archive font-patcher script in FontPatcher.zip for release
345+
run: |
346+
cd -- "$GITHUB_WORKSPACE/bin/scripts"
347+
./archive-font-patcher.sh
348+
349+
- name: Check if FontPatcher.zip contents changed
350+
id: updated-or-not
351+
run: |
352+
sudo apt install -y -q zipcmp
353+
(zipcmp archives/FontPatcher.zip ./FontPatcher.zip; \
354+
echo "updated=$?" >> $GITHUB_OUTPUT) || true
355+
356+
- name: Upload font-patcher archive for release
357+
uses: softprops/action-gh-release@v2
358+
if: needs.setup-fonts-matrix.outputs.rel_upload == 'true'
359+
with:
360+
draft: true
361+
prerelease: ${{ env.RELEASE_CANDIDATE != 'false' }}
362+
tag_name: "v${{ env.RELEASE_VERSION }}"
363+
files: archives/*
364+
365+
- name: Prepare commit
366+
if: steps.updated-or-not.outputs.updated != 0
367+
run: cp -f archives/FontPatcher.zip .
368+
369+
- name: Commit new FontPatcher.zip
370+
uses: EndBug/add-and-commit@v9
371+
if: steps.updated-or-not.outputs.updated != 0
372+
with:
373+
fetch: false
374+
add: 'FontPatcher.zip'
375+
message: "[ci] Update FontPatcher.zip"
376+
committer_name: GitHub Actions
377+
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
378+
379+
- name: Adjust release tag to include previous commit
380+
uses: EndBug/latest-tag@v1
381+
if: needs.setup-fonts-matrix.outputs.rel_upload == 'true'
382+
with:
383+
ref: "v${{ needs.setup-fonts-matrix.outputs.rel_version }}"
384+
376385
- name: Deploy CSS to gh-pages
377386
uses: JamesIves/github-pages-deploy-action@v4
378387
if: steps.push_css.outputs.pushed
@@ -404,9 +413,3 @@ jobs:
404413
git-config-name: GitHub Actions
405414
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
406415
clean: false
407-
408-
- name: Adjust release tag to include previous commit
409-
uses: EndBug/latest-tag@v1
410-
if: needs.setup-fonts-matrix.outputs.rel_upload == 'true'
411-
with:
412-
ref: "v${{ needs.setup-fonts-matrix.outputs.rel_version }}"

0 commit comments

Comments
 (0)