Skip to content

Commit 56f471c

Browse files
Merge pull request #16 from daniel-makerx/publish-action
build: add publish as a separate action
2 parents 0796841 + 2dc3b4e commit 56f471c

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

.github/workflows/cd.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,12 @@ jobs:
107107
path: dist/helloworld-*-py3-none-any.whl
108108
if-no-files-found: error
109109

110-
- name: Update homebrew formula
111-
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release == 'true'
112-
run: scripts/update-brew-formula.sh "dist/helloworld-*-py3-none-any.whl" "daniel-makerx/homebrew-core"
113-
env:
114-
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
110+
cd-publish-release-packages:
111+
name: Publish Release Packages
112+
needs: release
113+
# if: ${{ github.ref_name == 'chocolatey-package' }} && inputs.production_release != 'true' # used to test manual release from a branch
114+
if: ${{ github.ref_name == 'main' && inputs.production_release == 'true' }} # Might want to adjust this to publish (pre-release) on merge as well.
115+
uses: ./.github/workflows/publish-release-packages.yaml
116+
with:
117+
artifactName: helloworld
118+
secrets: inherit
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish packages to public repositories
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifactName:
7+
required: true
8+
type: string
9+
description: "The github artifact holding the wheel file which will be published"
10+
secrets:
11+
tapTokenOverride:
12+
required: false
13+
type: string
14+
description: "An override for the github token to publish to daniel-homebrew/homebrew-tap"
15+
16+
jobs:
17+
publish-brew:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout source code
21+
uses: actions/checkout@v3
22+
23+
- name: Download artifact
24+
uses: actions/download-artifact@v3
25+
with:
26+
name: ${{ inputs.artifactName }}
27+
path: dist
28+
29+
- name: Update homebrew formula
30+
run: scripts/update-brew-formula.sh "dist/helloworld-*-py3-none-any.whl" "daniel-makerx/homebrew-tap"
31+
env:
32+
TAP_GITHUB_TOKEN: ${{ secrets.tapTokenOverride || secrets.TAP_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)