Skip to content

Commit c20667d

Browse files
committed
add build & publish worklfow
1 parent 5535c79 commit c20667d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/cd.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CD Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- "services/[a-zA-Z]+/v[0-9]+.[0-9]+.[0-9]+"
7+
- "services/[a-zA-Z]+/v[0-9]+.[0-9]+.[0-9]+-*"
8+
workflow_dispatch:
9+
10+
jobs:
11+
main:
12+
name: Build & Publish module
13+
runs-on: "ubuntu-latest"
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Install Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.8"
21+
- name: Extract updated module path
22+
env:
23+
TAG: ${{ github.event.ref }}
24+
run: |
25+
TAG_NO_PREFIX=$(echo "$TAG" | sed 's/^refs\/tags\///')
26+
SERVICE_PATH=$(echo "$TAG_NO_PREFIX" | rev | cut -d'/' -f2- | rev)
27+
echo "SERVICE_PATH=$SERVICE_PATH" >> $GITHUB_ENV
28+
- name: Build & Publish to PyPi
29+
uses: JRubics/[email protected]
30+
with:
31+
pypi_token: ${{ secrets.PYPI_TOKEN }}
32+
poetry_publish_options: "--build"
33+
package_directory: $SERVICE_PATH

0 commit comments

Comments
 (0)