|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | ripunzip-version: |
7 | | - description: "what reference to checktout from google/runzip" |
| 7 | + description: What reference to checktout from google/runzip |
8 | 8 | required: false |
9 | 9 | openssl-version: |
10 | | - description: "what reference to checkout from openssl/openssl for Linux" |
| 10 | + description: What reference to checkout from openssl/openssl for Linux |
11 | 11 | 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 |
12 | 16 | pull_request: |
13 | 17 | paths: |
14 | 18 | - .github/workflows/build-ripunzip.yml |
@@ -68,11 +72,54 @@ jobs: |
68 | 72 | lipo -create -output ripunzip-macos \ |
69 | 73 | -arch x86_64 target/x86_64-apple-darwin/release/ripunzip \ |
70 | 74 | -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 |
71 | 86 | - uses: actions/upload-artifact@v4 |
72 | 87 | with: |
73 | 88 | name: ripunzip-${{ runner.os }} |
74 | | - path: ripunzip-* |
| 89 | + path: ripunzip-${{ runner.os }}.zip |
| 90 | + retention-days: 5 |
| 91 | + compression: 0 |
75 | 92 | - name: Check built binary |
76 | 93 | shell: bash |
77 | 94 | run: | |
| 95 | + rm -f ripunzip-*.zip |
78 | 96 | ./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