Skip to content

Commit 13612a9

Browse files
committed
ci: make publish event driven to allow for trusted publishing
When using Trusted Publishing to PyPI, we cannot do that from within a reusable workflow, therefore we make it independent, and trigger it with published event from release-please workflow, instead of calling it explicitly Refs: equinor/ecalc-internal#433
1 parent 3eeb8b9 commit 13612a9

5 files changed

Lines changed: 9 additions & 36 deletions

File tree

.github/workflows/on-push-any-branch.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches-ignore:
66
- 'main'
7-
- 'release/*'
87
tags-ignore:
98
- '**'
109

.github/workflows/on-push-main-branch.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
jobs:
88

9+
# NOTE: This job is needed in order to register a deployment in github (for a given environment), here libecalc-test. We need that in order
10+
# to be able to automatically move issues on the board to Done.
911
deploy-dummy:
1012
runs-on: ubuntu-24.04
1113
environment:
@@ -24,11 +26,6 @@ jobs:
2426
uses: ./.github/workflows/docs-publish.yml
2527
secrets: inherit
2628

27-
# We want/need to reserve patch bump in case we need to
28-
# patch a release that is deployed and active. Therefore
29-
# we bump minor here. Major bumps to versioning is currently
30-
# reserved to manual invocation of release-please.
31-
3229
release-please:
3330
uses: ./.github/workflows/release-please.yml
3431
secrets: inherit

.github/workflows/on-push-release-branch.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: Publish libeCalc package to PyPI
22

33
on:
4-
workflow_call:
5-
workflow_dispatch:
4+
release: # Trigger automatically, when a new release is made (with release-please)
5+
types: [published]
6+
7+
workflow_dispatch: # Trigger manually, if needed
8+
9+
# NOTE!: When using Trusted Publishing to PyPI, we cannot do that from within a reusable workflow, therefore
10+
# we make it independent, and trigger it with published event from release-please workflow, instead of calling explicitly.
611

712
jobs:
813
publish:

.github/workflows/release-please.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,3 @@ jobs:
1717
outputs:
1818
release_created: ${{ steps.release.outputs.release_created }}
1919
tag_name: ${{ steps.release.outputs.tag_name }}
20-
21-
deploy_prod:
22-
permissions:
23-
packages: write
24-
contents: read
25-
id-token: write
26-
needs: release-please
27-
uses: equinor/ecalc/.github/workflows/publish.yml@main
28-
if: ${{ needs.release-please.outputs.release_created }}

0 commit comments

Comments
 (0)