-
Notifications
You must be signed in to change notification settings - Fork 7
80 lines (66 loc) · 1.99 KB
/
on-push-to-main-branch.yml
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
name: On push to main branch
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
- name: Generate README
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: Python
dev_docs_slug: python
template_file: ./README.template.md
output_file: ./README.md
release-please:
needs: [build]
runs-on: ubuntu-24.04
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- uses: googleapis/release-please-action@v4
name: Release Please
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
publish:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-24.04
env:
VERSION: ${{ needs.release-please.outputs.tag_name }}
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-in-project: true
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Build package
run: poetry build
- name: Publish package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYTHON_CUSTOMER_SDK_PYPI_TOKEN }}
run: |
if [ -z "$VERSION" ]
then
echo "Unable to determine SDK version! Exiting!"
exit 1
fi
echo "Going to publish version=$VERSION"
poetry publish