Skip to content

Commit 4af1e3c

Browse files
committed
CI: make build-ripunzip.yml auto-create update PR
1 parent 3de598e commit 4af1e3c

1 file changed

Lines changed: 50 additions & 3 deletions

File tree

.github/workflows/build-ripunzip.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ on:
44
workflow_dispatch:
55
inputs:
66
ripunzip-version:
7-
description: "what reference to checktout from google/runzip"
7+
description: What reference to checktout from google/runzip
88
required: false
99
openssl-version:
10-
description: "what reference to checkout from openssl/openssl for Linux"
10+
description: What reference to checkout from openssl/openssl for Linux
1111
required: false
12+
open-pr:
13+
description: Open a pull request updating the ripunzip versions committed to lfs
14+
required: false
15+
default: true # will be false on PRs
1216
pull_request:
1317
paths:
1418
- .github/workflows/build-ripunzip.yml
@@ -68,11 +72,54 @@ jobs:
6872
lipo -create -output ripunzip-macos \
6973
-arch x86_64 target/x86_64-apple-darwin/release/ripunzip \
7074
-arch arm64 target/aarch64-apple-darwin/release/ripunzip
75+
- name: Archive (POSIX)
76+
if: runner.os != 'Windows'
77+
shell: bash
78+
run: |
79+
zip -j ripunzip-${{ runner.os }}.zip ripunzip-*
80+
- name: Archive (Windows)
81+
if: runner.os == 'Windows'
82+
shell: powershell
83+
run: |
84+
Compress-Archive -Path ripunzip-* -DestinationPath ripunzip-${{ runner.os }}.zip -Force
85+
- name: Upload built binary
7186
- uses: actions/upload-artifact@v4
7287
with:
7388
name: ripunzip-${{ runner.os }}
74-
path: ripunzip-*
89+
path: ripunzip-${{ runner.os }}.zip
90+
retention-days: 5
91+
compression: 0
7592
- name: Check built binary
7693
shell: bash
7794
run: |
95+
rm -f ripunzip-*.zip
7896
./ripunzip-* --version
97+
publish:
98+
needs: build
99+
if: inputs.open-pr == 'true'
100+
runs-on: ubuntu-slim
101+
steps:
102+
- uses: actions/checkout@v5
103+
with:
104+
sparse-checkout: |
105+
.github
106+
misc/ripunzip
107+
- name: Download built binaries
108+
uses: actions/download-artifact@v4
109+
with:
110+
merge: true
111+
path: misc/ripunzip
112+
- name: Open PR
113+
shell: bash
114+
run: |
115+
git config --global user.name "github-actions[bot]"
116+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
117+
git switch -c update-ripunzip
118+
git add misc/ripunzip
119+
git commit -m "Update ripunzip binaries to version ${{ inputs.ripunzip-version || env.RIPUNZIP_DEFAULT }}"
120+
git push --set-upstream origin update-ripunzip --force
121+
gh pr create \
122+
--title "Update ripunzip binaries to version ${{ inputs.ripunzip-version || env.RIPUNZIP_DEFAULT }}" \
123+
--body "Automated update of ripunzip binaries." \
124+
--assignee "@$GITHUB_ACTOR"
125+
gh pr merge --auto

0 commit comments

Comments
 (0)