Skip to content

Commit 8bfb550

Browse files
committed
Update release workflow with pypi push
Also updating version to v0.15.2 as v0.15.0/v0.15.1 has been used for testing.
1 parent 5e51c95 commit 8bfb550

File tree

4 files changed

+95
-56
lines changed

4 files changed

+95
-56
lines changed

.github/workflows/release.yaml

Lines changed: 78 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
1+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
22
#
33
# This program and the accompanying materials are made available under the
44
# terms of the Apache License, Version 2.0 which is available at
@@ -12,56 +12,92 @@
1212
#
1313
# SPDX-License-Identifier: Apache-2.0
1414

15-
name: Release workflow
15+
name: Github Release and PyPi Publish
1616

1717
on:
18-
release:
19-
types: [published, edited]
18+
workflow_dispatch:
19+
push:
20+
tags:
21+
- "v*.*.*"
2022

2123
jobs:
22-
release-package:
23-
name: Generate package binaries
24-
runs-on: ubuntu-latest
24+
build:
25+
name: Build distribution 📦
26+
runs-on: ubuntu-22.04
2527

2628
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
29+
- uses: actions/checkout@v4
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.10"
34+
- name: Install pypa/build
35+
run: pip install build --user
36+
- name: Build a binary wheel and a source tarball
37+
run: python3 -m build
38+
- name: Store the distribution packages
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: python-package-distributions
42+
path: |
43+
dist/
44+
LICENSE
45+
NOTICE.md
2946
30-
- name: Initialize python
31-
uses: actions/setup-python@v5
32-
with:
33-
python-version: "3.10"
47+
publish-to-pypi:
48+
name: Publish 🐍 to PyPI
49+
needs:
50+
- build
51+
runs-on: ubuntu-22.04
52+
environment:
53+
name: pypi
54+
url: https://pypi.org/p/velocitas-sdk
3455

35-
- name: Install Dependencies
36-
run: |
37-
python3 -m pip install --upgrade pip
38-
python3 -m pip install -r requirements.txt
56+
permissions:
57+
id-token: write
3958

40-
- name: Set tags output
41-
id: vars
42-
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
43-
44-
- name: Check output
45-
env:
46-
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
47-
run: |
48-
echo $RELEASE_VERSION
49-
echo ${{ steps.vars.outputs.tag }}
59+
steps:
60+
- name: Download dists folder
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: python-package-distributions
64+
path: python-package/
65+
- name: Publish distribution 📦 to PyPI
66+
uses: pypa/gh-action-pypi-publish@release/v1
67+
with:
68+
packages-dir: python-package/dist
5069

51-
- name: Test setup.cfg execution
52-
run: |
53-
sed -i -e 's/@tag/${{ steps.vars.outputs.tag }}/g' ./setup.py
54-
python3 setup.py sdist
70+
github-release:
71+
name: >-
72+
Create GitHub Release
73+
needs:
74+
- build
75+
runs-on: ubuntu-22.04
5576

56-
- name: Upload artifacts
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: release
60-
path: ./dist
77+
permissions:
78+
contents: write
79+
id-token: write
6180

62-
- name: Upload assets
63-
uses: softprops/action-gh-release@v1
64-
if: startsWith(github.ref, 'refs/tags/')
65-
with:
66-
files: |
67-
./dist/*
81+
steps:
82+
- name: Download dists folder
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: python-package-distributions
86+
path: python-package/
87+
- name: Sign the dists with Sigstore
88+
# If running on your own fork/organization
89+
# you must assure that sigstore has been added as authroized OAuth app in Github
90+
# Can be triggered by a manual run on CLI like "sigstore sign <somefile>"
91+
uses: sigstore/[email protected]
92+
with:
93+
inputs: >-
94+
./python-package/dist/*.tar.gz
95+
./python-package/dist/*.whl
96+
- name: Create release
97+
id: create_release
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
files: |
101+
python-package/dist/**
102+
python-package/LICENSE
103+
python-package/NOTICE.md

NOTICE-3RD-PARTY-CONTENT.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
|aiosignal|1.3.1|Apache 2.0|
88
|APScheduler|3.10.4|MIT|
99
|async-timeout|4.0.3|Apache 2.0|
10-
|attrs|23.2.0|MIT|
10+
|attrs|24.2.0|MIT|
1111
|build|1.2.1|MIT|
1212
|cachetools|5.4.0|MIT|
1313
|cfgv|3.4.0|MIT|
1414
|chardet|5.2.0|LGPL|
1515
|click|8.1.7|New BSD|
1616
|cloudevents|1.11.0|Apache 2.0|
1717
|colorama|0.4.6|BSD|
18-
|coverage|7.6.0|Apache 2.0|
18+
|coverage|7.6.1|Apache 2.0|
1919
|Deprecated|1.2.14|MIT|
2020
|deprecation|2.1.0|Apache 2.0|
2121
|distlib|0.3.8|Python Software Foundation License|
@@ -30,7 +30,7 @@
3030
|importlib-metadata|7.1.0|Apache 2.0|
3131
|iniconfig|2.0.0|MIT|
3232
|multidict|6.0.5|Apache 2.0|
33-
|mypy|1.11.0|MIT|
33+
|mypy|1.11.1|MIT|
3434
|mypy-extensions|1.0.0|MIT|
3535
|mypy-protobuf|3.6.0|Apache 2.0|
3636
|nodeenv|1.9.1|BSD|
@@ -54,25 +54,26 @@
5454
|pytest-asyncio|0.23.8|Apache 2.0|
5555
|pytest-cov|5.0.0|MIT|
5656
|pytz|2024.1|MIT|
57-
|PyYAML|6.0.1|MIT|
57+
|PyYAML|6.0.2|MIT|
5858
|setuptools|65.5.1|MIT|
5959
|six|1.16.0|MIT|
6060
|tomli|2.0.1|MIT|
61-
|tox|4.16.0|MIT|
61+
|tox|4.17.1|MIT|
6262
|types-Deprecated|1.2.9.20240311|Apache 2.0|
6363
|types-mock|5.1.0.20240425|Apache 2.0|
6464
|types-protobuf|5.27.0.20240626|Apache 2.0|
6565
|typing-extensions|4.12.2|Python Software Foundation License|
6666
|tzlocal|5.2|MIT|
6767
|virtualenv|20.26.3|MIT|
68-
|wheel|0.43.0|MIT|
68+
|wheel|0.44.0|MIT|
6969
|wrapt|1.16.0|BSD|
7070
|yarl|1.9.4|Apache 2.0|
7171
|zipp|3.19.2|MIT|
7272
## Workflows
7373
| Dependency | Version | License |
7474
|:-----------|:-------:|--------:|
7575
|actions/checkout|v4|MIT License|
76+
|actions/download-artifact|v4|MIT License|
7677
|actions/setup-java|v4|MIT License|
7778
|actions/setup-node|v4|MIT License|
7879
|actions/setup-python|v5|MIT License|
@@ -82,4 +83,6 @@
8283
|github/codeql-action|v3|MIT License|
8384
|mikepenz/action-junit-report|v4|Apache License 2.0|
8485
|pre-commit/action|v3.0.1|MIT License|
85-
|softprops/action-gh-release|v1|MIT License|
86+
|pypa/gh-action-pypi-publish|release/v1|BSD 3-Clause "New" or "Revised" License|
87+
|sigstore/gh-action-sigstore-python|v3.0.0|Apache License 2.0|
88+
|softprops/action-gh-release|v2|MIT License|

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apscheduler==3.10.4
1212
# via velocitas_sdk (setup.py)
1313
async-timeout==4.0.3
1414
# via aiohttp
15-
attrs==23.2.0
15+
attrs==24.2.0
1616
# via aiohttp
1717
build==1.2.1
1818
# via pip-tools
@@ -28,7 +28,7 @@ cloudevents==1.11.0
2828
# via velocitas_sdk (setup.py)
2929
colorama==0.4.6
3030
# via tox
31-
coverage[toml]==7.6.0
31+
coverage[toml]==7.6.1
3232
# via
3333
# coverage
3434
# pytest-cov
@@ -71,7 +71,7 @@ multidict==6.0.5
7171
# via
7272
# aiohttp
7373
# yarl
74-
mypy==1.11.0
74+
mypy==1.11.1
7575
# via velocitas_sdk (setup.py)
7676
mypy-extensions==1.0.0
7777
# via mypy
@@ -144,7 +144,7 @@ pytest-cov==5.0.0
144144
# via velocitas_sdk (setup.py)
145145
pytz==2024.1
146146
# via apscheduler
147-
pyyaml==6.0.1
147+
pyyaml==6.0.2
148148
# via pre-commit
149149
six==1.16.0
150150
# via apscheduler
@@ -157,7 +157,7 @@ tomli==2.0.1
157157
# pyproject-api
158158
# pytest
159159
# tox
160-
tox==4.16.0
160+
tox==4.17.1
161161
# via velocitas_sdk (setup.py)
162162
types-deprecated==1.2.9.20240311
163163
# via velocitas_sdk (setup.py)
@@ -175,7 +175,7 @@ virtualenv==20.26.3
175175
# via
176176
# pre-commit
177177
# tox
178-
wheel==0.43.0
178+
wheel==0.44.0
179179
# via pip-tools
180180
wrapt==1.16.0
181181
# via

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
setup(
6363
name="velocitas_sdk",
64-
version="0.15.0",
64+
version="0.15.2",
6565
description="A Python SDK for Vehicle app",
6666
long_description=long_description,
6767
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)