-
Notifications
You must be signed in to change notification settings - Fork 4
164 lines (141 loc) · 5.08 KB
/
release-please.yml
File metadata and controls
164 lines (141 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# This workflow handles both automated and manual package publishing:
#
# AUTOMATED PUBLISHING (on push to main):
# - Triggered automatically when changes are pushed to the main branch
# - Uses release-please to create releases based on conventional commits
# - Publishes packages to PyPI automatically when release PRs are merged
#
# MANUAL PUBLISHING (via workflow_dispatch):
# - Can be triggered manually from the Actions tab
# - Allows publishing a specific package to PyPI
# - Supports dry-run mode
#
name: release-please
on:
push:
branches:
- main
workflow_dispatch:
inputs:
workspace_path:
description: 'The workspace to publish'
required: true
default: 'packages/sdk/server-ai'
type: choice
options:
- packages/sdk/server-ai
- packages/ai-providers/server-ai-langchain
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
jobs:
release-please:
runs-on: ubuntu-latest
if: github.event_name == 'push'
outputs:
package-server-ai-released: ${{ steps.release.outputs['packages/sdk/server-ai--release_created'] }}
package-server-ai-langchain-released: ${{ steps.release.outputs['packages/ai-providers/server-ai-langchain--release_created'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
release-server-ai:
runs-on: ubuntu-latest
needs: ['release-please']
permissions:
id-token: write
contents: write
if: ${{ needs.release-please.outputs.package-server-ai-released == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
- uses: ./.github/actions/ci
with:
workspace_path: packages/sdk/server-ai
- uses: ./.github/actions/build
id: build
with:
workspace_path: packages/sdk/server-ai
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
name: 'Get PyPI token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ env.PYPI_AUTH_TOKEN }}
packages-dir: packages/sdk/server-ai/dist/
release-server-ai-langchain:
runs-on: ubuntu-latest
needs: ['release-please', 'release-server-ai']
permissions:
id-token: write
contents: write
if: ${{ always() && !failure() && !cancelled() && needs.release-please.outputs.package-server-ai-langchain-released == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
- uses: ./.github/actions/ci
with:
workspace_path: packages/ai-providers/server-ai-langchain
- uses: ./.github/actions/build
id: build
with:
workspace_path: packages/ai-providers/server-ai-langchain
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
name: 'Get PyPI token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ env.PYPI_AUTH_TOKEN }}
packages-dir: packages/ai-providers/server-ai-langchain/dist/
manual-publish:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
- uses: ./.github/actions/ci
with:
workspace_path: ${{ inputs.workspace_path }}
- uses: ./.github/actions/build
id: build
with:
workspace_path: ${{ inputs.workspace_path }}
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
if: ${{ inputs.dry_run != true }}
name: 'Get PyPI token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
- name: Publish to PyPI
if: ${{ inputs.dry_run != true }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ env.PYPI_AUTH_TOKEN }}
packages-dir: ${{ inputs.workspace_path }}/dist/