Skip to content

Commit 3c5c3e3

Browse files
authored
Merge pull request #153 from sovrasov/publish_workflow
Publish workflow
2 parents efd24ec + 9543a68 commit 3c5c3e3

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
workflow_dispatch: # run on request (no need for PR)
5+
release:
6+
types: [published]
7+
8+
permissions: {} # No permissions by default on workflow level
9+
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
persist-credentials: false
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
21+
with:
22+
python-version: "3.10"
23+
- name: Install pypa/build
24+
run: |
25+
python -m pip install --upgrade build
26+
- name: Build sdist
27+
run: |
28+
python -m build --sdist ./
29+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
30+
with:
31+
name: artifact-sdist
32+
path: dist/*.tar.gz
33+
- name: Build wheel
34+
run: |
35+
python -m build --wheel ./
36+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
37+
with:
38+
name: artifact-wheel
39+
path: dist/*.whl
40+
41+
publish_package:
42+
name: Publish package
43+
needs: [build]
44+
environment: pypi
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write # required by svenstaro/upload-release-action
48+
id-token: write # required by trusted publisher
49+
steps:
50+
- name: Download artifacts
51+
uses: actions/download-artifact@v4
52+
with:
53+
path: distr
54+
pattern: artifact-*
55+
merge-multiple: true
56+
- name: Upload package distributions to github
57+
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2
58+
with:
59+
repo_token: ${{ secrets.GITHUB_TOKEN }}
60+
file: distr/*
61+
tag: ${{ github.ref }}
62+
overwrite: true
63+
file_glob: true
64+
- name: Publish package distributions to PyPI
65+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
66+
with:
67+
packages-dir: distr/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ptflops versions log
22

3+
## v 0.7.5
4+
- Fix hook for nn.ConvTranspose2d
5+
36
## v 0.7.4
47
- Fix hook for nn.functional.interpolate.
58
- Add ignore and custom modules for aten.

0 commit comments

Comments
 (0)