Skip to content

Commit 67c8c15

Browse files
authored
Merge pull request #284 from ianhi/auto-release
Add automated release workflow
2 parents e364c99 + cd51fa0 commit 67c8c15

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Install node
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '14.x'
15+
registry-url: 'https://registry.npmjs.org'
16+
- name: Install Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.x'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install twine wheel build
24+
- name: Publish the Python package
25+
env:
26+
TWINE_USERNAME: __token__
27+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
28+
run: |
29+
python -m build
30+
twine upload dist/*
31+
- name: Publish the NPM package
32+
run: |
33+
cd js
34+
echo $PRE_RELEASE
35+
if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi
36+
npm publish --tag ${TAG} --access public
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
PRE_RELEASE: ${{ github.event.release.prerelease }}

0 commit comments

Comments
 (0)