Skip to content

Commit 19b2682

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

1 file changed

Lines changed: 43 additions & 3 deletions

File tree

.github/workflows/build-ripunzip.yml

Lines changed: 43 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,47 @@ 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
76+
shell: bash
77+
run: |
78+
zip -j ripunzip-${{ runner.os }}.zip ripunzip-*
7179
- uses: actions/upload-artifact@v4
7280
with:
7381
name: ripunzip-${{ runner.os }}
74-
path: ripunzip-*
82+
path: ripunzip-${{ runner.os }}.zip
83+
retention-days: 5
84+
compression: 0
7585
- name: Check built binary
7686
shell: bash
7787
run: |
88+
rm -f ripunzip-*.zip
7889
./ripunzip-* --version
90+
publish:
91+
needs: build
92+
if: inputs.open-pr == 'true'
93+
runs-on: ubuntu-slim
94+
steps:
95+
- uses: actions/checkout@v5
96+
with:
97+
sparse-checkout: |
98+
.github
99+
misc/ripunzip
100+
- name: Download built binaries
101+
uses: actions/download-artifact@v4
102+
with:
103+
merge: true
104+
path: misc/ripunzip
105+
- name: Open PR
106+
shell: bash
107+
run: |
108+
git config --global user.name "github-actions[bot]"
109+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
110+
git switch -c update-ripunzip
111+
git add misc/ripunzip
112+
git commit -m "Update ripunzip binaries to version ${{ inputs.ripunzip-version || env.RIPUNZIP_DEFAULT }}"
113+
git push --set-upstream origin update-ripunzip --force
114+
gh pr create \
115+
--title "Update ripunzip binaries to version ${{ inputs.ripunzip-version || env.RIPUNZIP_DEFAULT }}" \
116+
--body "Automated update of ripunzip binaries." \
117+
--assignee "@$GITHUB_ACTOR"
118+
gh pr merge --auto

0 commit comments

Comments
 (0)