Skip to content

Commit a8ae84b

Browse files
authored
Merge pull request #14 from treeverse/demo-boto
publish to pypi workflow
2 parents 01357b2 + 1122c6d commit a8ae84b

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pypi-publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: Tag/version to publish
10+
required: true
11+
jobs:
12+
13+
deploy:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
# Extract the version to 'version' based on workflow_dispatch or triggered tag in the published event
19+
- name: Extract version
20+
shell: bash
21+
run: |
22+
if [ "${{ github.event.inputs.tag }}" != "" ]; then
23+
echo "::set-output name=tag::$(echo ${{ github.event.inputs.tag }} | sed s/^v//)"
24+
else
25+
echo "::set-output name=tag::$(echo ${GITHUB_REF##*/} | sed s/^v//)"
26+
fi
27+
id: version
28+
29+
- name: Python build and make package
30+
run: make package-python PACKAGE_VERSION=${{ steps.version.outputs.tag }}
31+
32+
- name: Python publish package
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}
37+
packages_dir: dist/
38+
verbose: true
39+
40+
- name: Build release as latest
41+
working-directory: clients/python
42+
run: bundle exec jekyll build -d _site -b /

0 commit comments

Comments
 (0)