-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.31 KB
/
create_pypi_package.yaml
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
name: Build and publish PyPI artifact
on:
workflow_dispatch:
inputs:
bump_rule:
description: 'Bump rule'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
build_and_publish_package:
name: Build and publish the PyPi package
runs-on: ubuntu-latest
concurrency: publishing
steps:
- name: Checkout main
uses: actions/checkout@v2
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Patch package version
run: poetry version ${{ inputs.bump_rule }}
- name: Run Dockerfile to build and publish package into PyPI
run: |
docker build . -t ignored \
--build-arg PYPI_USERNAME=${{ secrets.PYPI_USERNAME }} \
--build-arg PYPI_PASSWORD=${{ secrets.PYPI_PASSWORD }}
- name: Update repository with up-to-date and version
run: |
git config --global user.email "[email protected]"
git config --global user.name "OpenDataDiscovery Bot"
if [ -n "$(git status --porcelain)" ]
then
git add .
git commit -m "chore: bump package version"
git push origin main
fi