|
93 | 93 | with: |
94 | 94 | generate_release_notes: true |
95 | 95 | files: artifacts/* |
96 | | - |
97 | | - homebrew: |
98 | | - name: Update Homebrew Formula |
99 | | - needs: release |
100 | | - runs-on: ubuntu-latest |
101 | | - steps: |
102 | | - - uses: actions/checkout@v4 |
103 | | - |
104 | | - - name: Download all artifacts |
105 | | - uses: actions/download-artifact@v4 |
106 | | - with: |
107 | | - path: artifacts |
108 | | - merge-multiple: true |
109 | | - |
110 | | - - name: Compute SHA256 checksums |
111 | | - id: sha |
112 | | - run: | |
113 | | - echo "aarch64_apple=$(sha256sum artifacts/ghdash-aarch64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" |
114 | | - echo "x86_64_apple=$(sha256sum artifacts/ghdash-x86_64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" |
115 | | - echo "aarch64_linux=$(sha256sum artifacts/ghdash-aarch64-unknown-linux-gnu.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" |
116 | | - echo "x86_64_linux=$(sha256sum artifacts/ghdash-x86_64-unknown-linux-gnu.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" |
117 | | -
|
118 | | - - name: Get version |
119 | | - id: version |
120 | | - run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" |
121 | | - |
122 | | - - name: Update formula |
123 | | - run: | |
124 | | - cat > Formula/ghdash.rb << 'FORMULA' |
125 | | - class Ghdash < Formula |
126 | | - desc "TUI GitHub dashboard for monitoring repos, PRs, and review inbox" |
127 | | - homepage "https://github.com/zombocoder/ghdash" |
128 | | - version "${{ steps.version.outputs.version }}" |
129 | | - license "Apache-2.0" |
130 | | -
|
131 | | - on_macos do |
132 | | - on_arm do |
133 | | - url "https://github.com/zombocoder/ghdash/releases/download/v#{version}/ghdash-aarch64-apple-darwin.tar.gz" |
134 | | - sha256 "${{ steps.sha.outputs.aarch64_apple }}" |
135 | | - end |
136 | | - on_intel do |
137 | | - url "https://github.com/zombocoder/ghdash/releases/download/v#{version}/ghdash-x86_64-apple-darwin.tar.gz" |
138 | | - sha256 "${{ steps.sha.outputs.x86_64_apple }}" |
139 | | - end |
140 | | - end |
141 | | -
|
142 | | - on_linux do |
143 | | - on_arm do |
144 | | - url "https://github.com/zombocoder/ghdash/releases/download/v#{version}/ghdash-aarch64-unknown-linux-gnu.tar.gz" |
145 | | - sha256 "${{ steps.sha.outputs.aarch64_linux }}" |
146 | | - end |
147 | | - on_intel do |
148 | | - url "https://github.com/zombocoder/ghdash/releases/download/v#{version}/ghdash-x86_64-unknown-linux-gnu.tar.gz" |
149 | | - sha256 "${{ steps.sha.outputs.x86_64_linux }}" |
150 | | - end |
151 | | - end |
152 | | -
|
153 | | - def install |
154 | | - bin.install "ghdash" |
155 | | - end |
156 | | -
|
157 | | - test do |
158 | | - assert_match "ghdash", shell_output("#{bin}/ghdash --version") |
159 | | - end |
160 | | - end |
161 | | - FORMULA |
162 | | -
|
163 | | - - name: Commit updated formula |
164 | | - run: | |
165 | | - git config user.name "github-actions[bot]" |
166 | | - git config user.email "github-actions[bot]@users.noreply.github.com" |
167 | | - git add Formula/ghdash.rb |
168 | | - git diff --cached --quiet && exit 0 |
169 | | - git commit -m "formula: update ghdash to ${{ steps.version.outputs.version }}" |
170 | | - git push origin HEAD:master |
0 commit comments