From 63267f2eac88234c56419f98db9943d9115a195f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Apr 2024 10:49:17 +0200 Subject: [PATCH 1/6] git-artifacts: fix indentation Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 840cff4..94cee4e 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -308,7 +308,7 @@ jobs: if test -z "$EXISTING_GIT_TAG" then git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD && - git bundle create "$b"/MINGW-packages.bundle origin/main..main + git bundle create "$b"/MINGW-packages.bundle origin/main..main elif ! git update-index --ignore-submodules --refresh || ! git diff-files --ignore-submodules || ! git diff-index --cached --ignore-submodules HEAD From bc5c1fb105607ef9fdf01d9d15202d1a6b2a6c25 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 24 Mar 2024 21:29:57 +0100 Subject: [PATCH 2/6] git-artifacts: avoid linter warning The linter has a hard time recognizing `core.setOutput()`. However, every `github-script` step has a naturally-defined output: `result`, set to the return value of the script. Let's use that instead. Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 94cee4e..20582f9 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -45,7 +45,7 @@ jobs: pkg: runs-on: ${{ github.event.inputs.architecture == 'aarch64' && fromJSON('["Windows", "ARM64"]') || 'windows-latest' }} outputs: - artifact_matrix: ${{steps.artifact-build-matrix.outputs.matrix}} + artifact_matrix: ${{ steps.artifact-build-matrix.outputs.result }} msystem: ${{steps.configure-environment.outputs.MSYSTEM}} mingw_package_prefix: ${{steps.configure-environment.outputs.MINGW_PACKAGE_PREFIX}} sdk_repo_arch: ${{steps.configure-environment.outputs.SDK_REPO_ARCH}} @@ -195,7 +195,7 @@ jobs: try { const output = createArtifactsMatrix(process.env.ARTIFACTS_TO_BUILD, process.env.ARCHITECTURE) core.info(`Will be using the following matrix: ${JSON.stringify(output)}`) - core.setOutput('matrix', output) + return output } catch (e) { core.setFailed(e.message) } From bc0b46c5614cb88a917f6f188cfc412b1a90222d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 21 Apr 2024 21:26:18 +0200 Subject: [PATCH 3/6] git-artifacts: report selected artifacts in the workflow run's name The name given to a particular workflow run is shown in the overview of workflow runs in GitHub's UI, and are therefore a really good spot to surface information that is relevant to the reader. For example, if a `git-artifacts` workflow run was started with only a subset of the artifacts to build, let's state that in the workflow run's name, as it is vital information. Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 20582f9..cabd8ca 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -1,5 +1,5 @@ name: git-artifacts -run-name: Build git-artifacts (${{ inputs.architecture }}) +run-name: Build git-artifacts (${{ inputs.artifacts != '' && format('{0} ', inputs.artifacts) || '' }}${{ inputs.architecture }}) on: workflow_dispatch: From 49ba767ce54a4b26609a28121e25d596d7ac79fe Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Apr 2024 12:22:39 +0200 Subject: [PATCH 4/6] git-artifacts: only populate /usr/bin/git when really necessary Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index cabd8ca..0bf1977 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -287,7 +287,10 @@ jobs: set -x BUILD_SRC=$(test x86_64 != "$ARCHITECTURE" || echo "--build-src-pkg") # Make sure that there is a `/usr/bin/git` that can be used by `makepkg-mingw` - printf '#!/bin/sh\n\nexec '$MINGW_PREFIX'/bin/git.exe "$@"\n' >/usr/bin/git && + if test ! -x /usr/bin/git + then + printf '#!/bin/sh\n\nexec '$MINGW_PREFIX'/bin/git.exe "$@"\n' >/usr/bin/git + fi && ( cd /usr/src/MINGW-packages/mingw-w64-git/src/git && /usr/src/build-extra/please.sh build-mingw-w64-git --reset-pkgrel --only-$ARCHITECTURE $BUILD_SRC \ From dee3b73c41c6cdf3c7dcc75c9ac8935b7320be77 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 25 Mar 2024 08:22:52 +0100 Subject: [PATCH 5/6] git-artifacts: don't forget to commit MINGW-packages, if needed When building from a tag, the version in mingw-w64-git's `PKGBUILD` will be changed as part of the build. We already had code intending to publish that change, but we forgot to commit it before building a Git bundle, which does not work... Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 0bf1977..421be08 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -318,6 +318,7 @@ jobs: then echo "::warning::Uncommitted changes after build!" >&2 && git diff >&2 && + git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD && git bundle create "$b"/MINGW-packages.bundle main^..main fi) - name: Cache ${{env.MINGW_PACKAGE_PREFIX}}-git From e3df72fe87b33d7edc362635775bb14bee2cac72 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 22 Apr 2024 20:08:00 +0200 Subject: [PATCH 6/6] git-artifacts: correct the packager information of the Pacman packages We currently use a bogus `PACKAGER` information that is derived from the `${{ github.actor }}`, which is the GitForWindowsHelper GitHub App. Since we're already using my personal GPG key to sign those packages, might just as well use my name as the packager, too. Signed-off-by: Johannes Schindelin --- .github/workflows/git-artifacts.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml index 421be08..95d8437 100644 --- a/.github/workflows/git-artifacts.yml +++ b/.github/workflows/git-artifacts.yml @@ -268,7 +268,8 @@ jobs: echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import && info="$(gpg --list-keys --with-colons "${GPGKEY%% *}" | cut -d : -f 1,10 | sed -n '/^uid/{s|uid:||p;q}')" && git config --global user.name "${info% <*}" && - git config --global user.email "<${info#*<}" + git config --global user.email "<${info#*<}" && + echo "PACKAGER=$info" >>$GITHUB_ENV env: GPGKEY: ${{secrets.GPGKEY}} - name: update check-run