Skip to content

Commit e6a1918

Browse files
committed
setup release
1 parent 647fcd0 commit e6a1918

File tree

3 files changed

+276
-22
lines changed

3 files changed

+276
-22
lines changed

.github/workflows/release.yml

Lines changed: 87 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,92 @@
1-
name: Release on JFrog
2-
on:
3-
push:
4-
tags:
5-
- "v*"
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
64

75
jobs:
8-
documentation:
9-
name: Publish package to JFrog
6+
build:
7+
name: Build distribution 📦
108
runs-on: ubuntu-latest
9+
1110
steps:
12-
- uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
15-
- name: Install uv
16-
uses: astral-sh/setup-uv@v5
17-
with:
11+
- uses: actions/checkout@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v4
14+
with:
1815
# Install a specific version of uv.
19-
version: "0.5.1"
20-
enable-cache: true
21-
cache-dependency-glob: "uv.lock"
22-
- name: Install dependencies
23-
run: uv sync
24-
- name: Build
25-
run: uv build
26-
- name: Publish
27-
run: uv publish --publish-url ${{secrets.JFROG_KIRIN_URL}} --username ${{secrets.JFROG_KIRIN_USERNAME}} --password ${{secrets.JFROG_KIRIN_PASSWORD}}
16+
version: "0.5.5"
17+
enable-cache: true
18+
cache-dependency-glob: "uv.lock"
19+
- name: Install the project
20+
run: uv sync --all-extras --dev
21+
- name: Build distribution 📦
22+
run: uv build
23+
- name: Store the distribution packages
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: python-package-distributions
27+
path: dist/
28+
29+
publish-to-pypi:
30+
name: >-
31+
Publish Python 🐍 distribution 📦 to PyPI
32+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
33+
needs:
34+
- build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: pypi
38+
url: https://pypi.org/p/griffe-kirin # Replace <package-name> with your PyPI project name
39+
permissions:
40+
id-token: write # IMPORTANT: mandatory for trusted publishing
41+
42+
steps:
43+
- name: Download all the dists
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
- name: Publish distribution 📦 to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
51+
github-release:
52+
name: >-
53+
Sign the Python 🐍 distribution 📦 with Sigstore
54+
and upload them to GitHub Release
55+
needs:
56+
- publish-to-pypi
57+
runs-on: ubuntu-latest
58+
59+
permissions:
60+
contents: write # IMPORTANT: mandatory for making GitHub Releases
61+
id-token: write # IMPORTANT: mandatory for sigstore
62+
63+
steps:
64+
- name: Download all the dists
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: python-package-distributions
68+
path: dist/
69+
- name: Sign the dists with Sigstore
70+
uses: sigstore/gh-action-sigstore-python@v3.0.0
71+
with:
72+
inputs: >-
73+
./dist/*.tar.gz
74+
./dist/*.whl
75+
- name: Create GitHub Release
76+
env:
77+
GITHUB_TOKEN: ${{ github.token }}
78+
run: >-
79+
gh release create
80+
'${{ github.ref_name }}'
81+
--repo '${{ github.repository }}'
82+
--notes ""
83+
- name: Upload artifact signatures to GitHub Release
84+
env:
85+
GITHUB_TOKEN: ${{ github.token }}
86+
# Upload to GitHub Release using the `gh` CLI.
87+
# `dist/` contains the built packages, and the
88+
# sigstore-produced signatures and certificates.
89+
run: >-
90+
gh release upload
91+
'${{ github.ref_name }}' dist/**
92+
--repo '${{ github.repository }}'

.gitignore

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# random
2+
job.json
3+
out.txt
4+
.DS_Store
5+
tests/data/jobs/
6+
main.html
7+
debug/
8+
9+
**/flair-python.code-workspace
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
share/python-wheels/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
MANIFEST
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.nox/
53+
.coverage
54+
.coverage.*
55+
.cache
56+
nosetests.xml
57+
coverage.xml
58+
*.cover
59+
*.py,cover
60+
.hypothesis/
61+
.pytest_cache/
62+
cover/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Django stuff:
69+
*.log
70+
local_settings.py
71+
db.sqlite3
72+
db.sqlite3-journal
73+
74+
# Flask stuff:
75+
instance/
76+
.webassets-cache
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# doc slides
85+
docs/slides/**/**.pdf
86+
docs/slides/build/**/**.png
87+
**/**/**.pptx
88+
89+
# mkdocs
90+
site/
91+
docs/reference/bloqade/
92+
93+
# PyBuilder
94+
.pybuilder/
95+
target/
96+
97+
# Jupyter Notebook
98+
.ipynb_checkpoints
99+
100+
# IPython
101+
profile_default/
102+
ipython_config.py
103+
104+
# pyenv
105+
# For a library or package, you might want to ignore these files since the code is
106+
# intended to run in multiple environments; otherwise, check them in:
107+
# .python-version
108+
109+
# pipenv
110+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
111+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
112+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
113+
# install all needed dependencies.
114+
#Pipfile.lock
115+
116+
# poetry
117+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
118+
# This is especially recommended for binary packages to ensure reproducibility, and is more
119+
# commonly ignored for libraries.
120+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
121+
#poetry.lock
122+
123+
# pdm
124+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
125+
#pdm.lock
126+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
127+
# in version control.
128+
# https://pdm.fming.dev/#use-with-ide
129+
.pdm.toml
130+
131+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132+
__pypackages__/
133+
134+
# Celery stuff
135+
celerybeat-schedule
136+
celerybeat.pid
137+
138+
# SageMath parsed files
139+
*.sage.py
140+
141+
# Environments
142+
.env
143+
.venv*
144+
env/
145+
venv/
146+
ENV/
147+
env.bak/
148+
venv.bak/
149+
150+
# Spyder project settings
151+
.spyderproject
152+
.spyproject
153+
154+
# Rope project settings
155+
.ropeproject
156+
157+
# mkdocs documentation
158+
/site
159+
160+
# mypy
161+
.mypy_cache/
162+
.dmypy.json
163+
dmypy.json
164+
165+
# Pyre type checker
166+
.pyre/
167+
168+
# pytype static type analyzer
169+
.pytype/
170+
171+
# Cython debug symbols
172+
cython_debug/
173+
174+
# PyCharm
175+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
176+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
177+
# and can be added to the global gitignore or merged into this file. For a more nuclear
178+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
179+
#.idea/
180+
181+
.vscode
182+
!.vscode/settings.json
183+
.pdm-python
184+
main.py
185+
*.ipynb
186+
*.json
187+
.ruff_cache
188+
.python-version
189+
!package.json
-10.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)