You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflows will upload a Python Package using Twine when a release is created
2
-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
-
4
-
name: Upload Pylenium Package
1
+
name: Upload Pylenium Package to pypi
5
2
6
3
on:
7
4
release:
8
5
types: [created]
9
6
workflow_dispatch:
10
7
inputs:
11
-
version:
12
-
description: 'The version to publish to pypi'
13
-
required: true
14
-
default: 'develop'
8
+
version:# keeping this for eventaul autobump feature
9
+
description: "The version to publish to pypi"
10
+
required: false
11
+
default: "develop"
15
12
16
13
jobs:
17
-
deploy:
14
+
pypi-publish:
15
+
name: upload release to PyPI
18
16
runs-on: ubuntu-latest
19
-
17
+
permissions:
18
+
# IMPORTANT: this permission is mandatory for trusted publishing
19
+
id-token: write
20
20
steps:
21
21
- uses: actions/checkout@v2
22
-
-
23
-
name: Set up Python
22
+
23
+
-name: Set up Python
24
24
uses: actions/setup-python@v2
25
25
with:
26
26
python-version: "3.x"
27
-
-
28
-
name: Autobump version
29
-
run: |
30
-
# from refs/tags/v1.2.3 get 1.2.3
31
-
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
32
-
PLACEHOLDER='__version__ = "develop"'
33
-
VERSION_FILE='pylenium/__init__.py'
34
-
# ensure the placeholder is there. If grep doesn't find the placeholder
35
-
# it exits with exit code 1 and github actions aborts the build.
36
-
grep "$PLACEHOLDER" "$VERSION_FILE"
37
-
if [ ${{ github.event.inputs.version }} != "develop" ]; then
38
-
VERSION=${{ github.event.inputs.version }}
39
-
fi
40
-
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
0 commit comments