-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (39 loc) · 1.16 KB
/
CD.yml
File metadata and controls
45 lines (39 loc) · 1.16 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
on:
push:
branches:
- main
name: ShipEngine Python CD
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
# Checkout code if release was created
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# Setup Python if release was created
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
if: ${{ steps.release.outputs.release_created }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
if: ${{ steps.release.outputs.release_created }}
- name: Build the code
run: |
poetry build
if: ${{ steps.release.outputs.release_created }}
- name: Publish package
run: |
poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
if: ${{ steps.release.outputs.release_created }}