Skip to content

Commit 52234e8

Browse files
update yml file to upload package (#159)
Signed-off-by: Balram Choudhary <bchoudhary@rocketsoftware.com>
1 parent b6cba39 commit 52234e8

File tree

2 files changed

+35
-26
lines changed

2 files changed

+35
-26
lines changed
Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
name: Build and upload to PyPI
1+
name: Publish IBM_DB_SA Package
22

3-
# Build on every workflow_dispatch, branch push, tag push, and pull request change
43
on:
54
workflow_dispatch:
65
pull_request:
@@ -11,29 +10,39 @@ on:
1110
tags:
1211
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
1312

14-
jobs:
15-
deploy:
13+
permissions:
14+
contents: read
15+
id-token: write # Required for trusted publishing to PyPI via OIDC
1616

17+
jobs:
18+
publish-pypi:
19+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
1720
runs-on: ubuntu-latest
21+
environment: pypi # Environment where PYPI_API_TOKEN secret is stored
1822

1923
steps:
20-
- uses: actions/checkout@v4
21-
- name: Set up Python
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: '3.x'
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install build
29-
- name: Build package
30-
run: |
31-
python -m build
32-
- name: Publish distribution to PyPI
33-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
34-
uses: pypa/gh-action-pypi-publish@release/v1
35-
36-
permissions:
37-
# IMPORTANT: this permission is mandatory for trusted publishing
38-
id-token: write
39-
contents: write # Added permission for GitHub Actions to push tags
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.x'
31+
32+
- name: Install build dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install build
36+
37+
- name: Build package
38+
run: python -m build
39+
40+
- name: Publish to PyPI with trusted publishing (OIDC)
41+
uses: pypa/gh-action-pypi-publish@v1.5.0
42+
with:
43+
# Use GitHub OIDC token to authenticate instead of password
44+
# The action supports OIDC automatically when password is empty
45+
# so leave password empty and it will use OIDC.
46+
user: __token__
47+
password: ${{ secrets.PYPI_API_TOKEN }}
48+
packages_dir: dist

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
setup(
2020
name='ibm_db_sa',
2121
version=VERSION,
22-
license='Apache License 2.0',
22+
license = "Apache-2.0",
23+
license_files = ("LICENSE",),
2324
description='SQLAlchemy support for IBM Data Servers',
2425
author='IBM Application Development Team',
2526
author_email='balram.choudhary@ibm.com',
@@ -30,7 +31,6 @@
3031
classifiers=[
3132
'Development Status :: 5 - Production/Stable',
3233
'Intended Audience :: Developers',
33-
'License :: OSI Approved :: Apache Software License',
3434
'Operating System :: OS Independent',
3535
'Topic :: Database :: Front-Ends'
3636
],

0 commit comments

Comments
 (0)