Skip to content

Commit 4752f75

Browse files
committed
feat: configure automatic package and container publishing on release - Modified release-please workflow to trigger publishing when release is created - Added publish-package and publish-image jobs that run after successful release - Changed existing release.yaml to manual workflow to avoid conflicts - Publishing now happens automatically when release-please PR is merged
1 parent ffd86b2 commit 4752f75

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

.github/workflows/release-please.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,45 @@ jobs:
2525
with:
2626
config-file: .release-please-config.json
2727
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
publish-package:
30+
needs: release-please
31+
if: ${{ needs.release-please.outputs.release_created }}
32+
runs-on: ubuntu-latest
33+
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
fetch-tags: true
42+
- uses: asdf-vm/actions/install@v4
43+
- name: Publish package to PyPI
44+
run: make publish-package
45+
46+
publish-image:
47+
needs: release-please
48+
if: ${{ needs.release-please.outputs.release_created }}
49+
runs-on: ubuntu-latest
50+
51+
strategy:
52+
matrix:
53+
arch: [linux/amd64, linux/arm64]
54+
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 1
62+
- run: git fetch --tags origin
63+
- run: git checkout ${{ needs.release-please.outputs.tag_name }}
64+
- uses: docker/setup-qemu-action@v3
65+
- uses: docker/setup-buildx-action@v3
66+
- name: Publish container image
67+
run: make publish-image
68+
env:
69+
DOCKER_DEFAULT_PLATFORM: ${{ matrix.arch }}

.github/workflows/release.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Release
1+
name: Manual Release
22

33
on:
4-
push:
5-
tags:
6-
- '*'
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag to release'
8+
required: true
9+
type: string
710

811
permissions: write-all
912

@@ -18,6 +21,7 @@ jobs:
1821
steps:
1922
- uses: actions/checkout@v4
2023
with:
24+
ref: ${{ github.event.inputs.tag }}
2125
fetch-tags: true
2226
- uses: asdf-vm/actions/install@v4
2327
- run: make publish-package
@@ -35,9 +39,9 @@ jobs:
3539
steps:
3640
- uses: actions/checkout@v4
3741
with:
42+
ref: ${{ github.event.inputs.tag }}
3843
fetch-depth: 1
3944
- run: git fetch --tags origin
40-
- run: git checkout ${{ github.ref }}
4145
- uses: docker/setup-qemu-action@v3
4246
- uses: docker/setup-buildx-action@v3
4347
- run: make publish-image

0 commit comments

Comments
 (0)