Skip to content

Commit 5455e75

Browse files
authored
drop-pacman-package: support MINGW packages and UCRT64 (#176)
Previously, the workflow would only work for packages whose name is unchanged across Git for Windows SDKs, i.e. MSYS packages. However, MINGW packages' names start with a prefix that encodes the architecture. Let's support that via `mingw-w64-<name>`, which is auto-expanded to `${MINGW_PACKAGE_PREFIX}-<name>`. While at it, also support UCRT64, which [is currently developed](git-for-windows/git-sdk-64#117) on the `ucrt64` branch of git-sdk-64.
2 parents a3f219b + 0aa0de5 commit 5455e75

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/drop-pacman-package.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Drop Pacman package from SDKs
1+
name: Drop (uninstall) Pacman package from SDKs
2+
run-name: Drop (uninstall) Pacman package ${{ inputs.package }} from SDKs
23

34
on:
45
workflow_dispatch:
@@ -22,23 +23,38 @@ jobs:
2223
drop-pacman-package:
2324
strategy:
2425
matrix:
25-
sdk: [git-sdk-64, git-sdk-arm64, git-sdk-32]
26-
runs-on: ${{ matrix.sdk == 'git-sdk-arm64' && 'windows-11-arm' || 'windows-latest' }}
26+
sdk:
27+
- name: git-sdk-64
28+
mingw-package-prefix: mingw-w64-x86_64
29+
- name: git-sdk-64
30+
ref: ucrt64
31+
mingw-package-prefix: mingw-w64-ucrt-x86_64
32+
- name: git-sdk-arm64
33+
mingw-package-prefix: mingw-w64-clang-aarch64
34+
- name: git-sdk-32
35+
mingw-package-prefix: mingw-w64-i686
36+
runs-on: ${{ matrix.sdk.name == 'git-sdk-arm64' && 'windows-11-arm' || 'windows-latest' }}
2737
steps:
38+
- name: Special-case MINGW packages
39+
if: startsWith(env.PACKAGE, 'mingw-w64-')
40+
shell: bash
41+
run:
42+
echo "PACKAGE=${{ matrix.sdk.mingw-package-prefix }}-${PACKAGE#mingw-w64-}" >>$GITHUB_ENV
2843
- name: obtain installation access token
2944
uses: actions/create-github-app-token@v3
3045
id: sdk-repo-token
3146
with:
3247
app-id: ${{ secrets.GH_APP_ID }}
3348
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
3449
owner: ${{ github.repository_owner }}
35-
repositories: ${{ matrix.sdk }}
36-
- name: clone ${{ matrix.sdk }}
50+
repositories: ${{ matrix.sdk.name }}
51+
- name: clone ${{ matrix.sdk.name }}
3752
uses: actions/checkout@v6
3853
with:
3954
persist-credentials: true
40-
repository: ${{ github.repository_owner }}/${{ matrix.sdk }}
55+
repository: ${{ github.repository_owner }}/${{ matrix.sdk.name }}
4156
token: ${{ steps.sdk-repo-token.outputs.token }}
57+
ref: ${{ matrix.sdk.ref }}
4258
- name: use the SDK's Bash and git.exe
4359
run: "usr\\bin\\bash.exe -lc 'cygpath -aw /usr/bin >>$GITHUB_PATH && cygpath -aw /cmd >>$GITHUB_PATH'"
4460
- name: Remove ${{ env.PACKAGE }}
@@ -63,7 +79,7 @@ jobs:
6379
git switch -c "$branch" &&
6480
git add -A . &&
6581
if git diff --cached --quiet; then
66-
echo "::warning::${{ matrix.sdk }}: no changes to commit!"
82+
echo "::warning::${{ matrix.sdk.name }}: no changes to commit!"
6783
exit 0
6884
fi &&
6985
commit_message="Drop package '$PACKAGE'
@@ -81,7 +97,7 @@ jobs:
8197
gh pr create \
8298
--fill \
8399
--head "$branch" \
84-
--base main 2>&1;
100+
--base ${{ matrix.sdk.ref || 'main' }} 2>&1;
85101
echo $? >/tmp/exit.status
86102
) |
87103
tee -a /tmp/pr-create-output.txt &&

0 commit comments

Comments
 (0)