Skip to content

Commit bf358c6

Browse files
Merge pull request #10 from codelathe/feature/add-release-to-pypi-workflow
Create release.yml
2 parents 3e2bec8 + 97de86c commit bf358c6

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Check dependencies
2424
run: make doctor
2525

26-
- uses: actions/cache@v2
26+
- uses: actions/cache@v4
2727
with:
2828
path: .venv
2929
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-build:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.x"
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build
29+
30+
- name: Build release distributions
31+
run: python -m build
32+
33+
- name: Upload distributions
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: release-dists
37+
path: dist/
38+
39+
pypi-publish:
40+
runs-on: ubuntu-latest
41+
needs: release-build
42+
permissions:
43+
id-token: write # Required for OIDC authentication
44+
45+
environment:
46+
name: pypi
47+
url: https://pypi.org/project/filecloudapi-python/
48+
49+
steps:
50+
- name: Download release distributions
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: release-dists
54+
path: dist/
55+
56+
- name: Publish to PyPI
57+
uses: pypa/gh-action-pypi-publish@release/v1
58+
with:
59+
packages-dir: dist/

0 commit comments

Comments
 (0)