Skip to content

Commit a2a4f1e

Browse files
author
Agus Makmun
committed
feat: add automatic release & upload to pypi
1 parent f68a762 commit a2a4f1e

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release and PyPI Upload
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 14
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Semantic Release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: npx semantic-release
28+
29+
upload-to-pypi:
30+
needs: release
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v2
36+
37+
- name: Setup Python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: 3.8
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
python -m pip install twine
46+
47+
- name: Build and upload to PyPI
48+
run: |
49+
python setup.py sdist bdist_wheel
50+
twine upload dist/*
51+
env:
52+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
53+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)