Skip to content

Commit b8aea43

Browse files
committed
ci: test workflow for scoop/homebrew release prep
1 parent d7a0e13 commit b8aea43

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed
Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: Publish to Homebrew & Scoop Repositories
22

33
on:
4-
# Automatic trigger after release workflow completes
5-
workflow_run:
6-
workflows: ["Build and Publish Release Packages"]
7-
types:
8-
- completed
9-
# Manual trigger for testing
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
109
workflow_dispatch:
1110
inputs:
1211
version:
@@ -17,39 +16,19 @@ jobs:
1716
dispatch:
1817
name: Dispatch update events
1918
runs-on: ubuntu-latest
20-
# Only run automatically if upstream workflow succeeded
21-
if: |
22-
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
23-
github.event_name == 'workflow_dispatch'
24-
2519
steps:
26-
- name: Determine release version
27-
id: vars
28-
run: |
29-
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
30-
REF="${{ github.event.workflow_run.head_branch }}"
31-
if [[ "$REF" == v* ]]; then
32-
VERSION="${REF#v}"
33-
else
34-
VERSION="$REF"
35-
fi
36-
else
37-
VERSION="${{ github.event.inputs.version }}"
38-
fi
39-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
40-
4120
- name: Dispatch update to homebrew-wireport
4221
uses: peter-evans/repository-dispatch@v3
4322
with:
4423
token: ${{ secrets.CROSS_REPO_PACKAGE_TOKEN }}
4524
repository: MultionLabs/homebrew-wireport
4625
event-type: update-formula
47-
client-payload: '{"version":"${{ steps.vars.outputs.version }}"}'
26+
client-payload: '{"version":"${{ inputs.version }}"}'
4827

4928
- name: Dispatch update to scoop-wireport
5029
uses: peter-evans/repository-dispatch@v3
5130
with:
5231
token: ${{ secrets.CROSS_REPO_PACKAGE_TOKEN }}
5332
repository: MultionLabs/scoop-wireport
5433
event-type: update-bucket
55-
client-payload: '{"version":"${{ steps.vars.outputs.version }}"}'
34+
client-payload: '{"version":"${{ inputs.version }}"}'

.github/workflows/release-packages.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ jobs:
137137
runs-on: ubuntu-latest
138138
needs: [linux-build, macos-build, docker-publish]
139139
if: github.event_name == 'push' || inputs.publish_release == 'true'
140+
outputs:
141+
version: ${{ steps.vars.outputs.version }}
140142

141143
permissions:
142144
contents: write
@@ -169,3 +171,15 @@ jobs:
169171
draft: false
170172
prerelease: false
171173
files: dist-aggregate/**
174+
175+
#-------------------------------------------------------------------
176+
# Job: notify-package-repos (reusable workflow call)
177+
#-------------------------------------------------------------------
178+
notify-package-repos:
179+
name: Notify Homebrew & Scoop Repositories
180+
needs: publish
181+
if: needs.publish.result == 'success'
182+
uses: ./.github/workflows/notify-package-repos.yml
183+
with:
184+
version: ${{ needs.publish.outputs.version }}
185+
secrets: inherit

0 commit comments

Comments
 (0)