Skip to content

Commit 76d6356

Browse files
committed
feat(publish): pypi publish를 위한 workflow를 추가하다
publish 될 경우를 Trigger하여 자동으로 pypi에 package를 publish
1 parent f904ce8 commit 76d6356

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish to PyPi
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Extract tag name
30+
id: tag
31+
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
32+
- name: Build Package python-version
33+
env:
34+
GITHUB_ACTION_TAG_NAME: "${{ steps.tag.outputs.TAG_NAME }}"
35+
run: |
36+
echo "$GITHUB_ACTION_TAG_NAME"
37+
python build_package_version.py -i openexr_python/__init__.py
38+
- name: Install dependencies
39+
run: |
40+
pip install build
41+
- name: Build package
42+
run: python -m build
43+
- name: Publish package
44+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
45+
with:
46+
user: __token__
47+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)