-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.63 KB
/
Copy pathrelease-py.yml
File metadata and controls
89 lines (75 loc) · 2.63 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
# PyPI 배포: Repository Settings → Secrets and variables → Actions 에서 PYPI_TOKEN (PyPI API token) 등록 필요.
name: Release Python packages
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
publish-planforge-core:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: pip install build twine
- name: Verify tag version matches planforge-core version
if: github.event_name == 'push'
working-directory: packages/core
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CORE_VERSION=$(grep -E '^version\s*=' pyproject.toml | sed 's/.*=\s*"\(.*\)".*/\1/')
echo "Tag version: ${TAG_VERSION}"
echo "planforge-core version: ${CORE_VERSION}"
if [[ "${TAG_VERSION}" != "${CORE_VERSION}" ]]; then
echo "Tag version and planforge-core version must match."
exit 1
fi
- name: Build planforge-core
working-directory: packages/core
run: python -m build
- name: Publish planforge-core to PyPI
working-directory: packages/core
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
publish-planforge-cli:
runs-on: ubuntu-latest
needs: publish-planforge-core
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: pip install build twine
- name: Verify tag version matches planforge (CLI) version
if: github.event_name == 'push'
working-directory: packages/cli-py
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CLI_VERSION=$(grep -E '^version\s*=' pyproject.toml | sed 's/.*=\s*"\(.*\)".*/\1/')
echo "Tag version: ${TAG_VERSION}"
echo "planforge (CLI) version: ${CLI_VERSION}"
if [[ "${TAG_VERSION}" != "${CLI_VERSION}" ]]; then
echo "Tag version and planforge CLI version must match."
exit 1
fi
- name: Build planforge CLI
working-directory: packages/cli-py
run: python -m build
- name: Publish planforge CLI to PyPI
working-directory: packages/cli-py
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*