Skip to content

Commit 5cf7ad3

Browse files
committed
feat: github workflow files added
1 parent 67838ea commit 5cf7ad3

3 files changed

Lines changed: 124 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: ["3.14"]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set Up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install -e ".[dev]"

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set Up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.14"
24+
25+
- name: Install Build
26+
run: |
27+
pip install setuptools wheel setuptools_scm>=6.2
28+
pip install build
29+
30+
- name: Build Package
31+
run: |
32+
echo "GitHub Release Tag: ${{ github.event.release.tag_name }}"
33+
34+
VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
35+
echo "Building Version: $VERSION"
36+
37+
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
38+
39+
python -m build --no-isolation
40+
41+
ls -la dist/
42+
43+
- name: Publish Package To PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set Up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.14"
21+
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install setuptools wheel setuptools_scm>=6.2
26+
python -m pip install -e ".[dev]"
27+
python -m pip install build
28+
29+
- name: Build Package
30+
run: |
31+
echo "GitHub Ref: $GITHUB_REF"
32+
echo "GitHub Ref Name: $GITHUB_REF_NAME"
33+
34+
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//')
35+
echo "Building Version: $VERSION"
36+
37+
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
38+
39+
python -m build --no-isolation
40+
41+
echo "Built Packages In Dist/"
42+
ls -la dist/
43+
44+
- name: Create GitHub Release
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
files: |
48+
dist/*.tar.gz
49+
dist/*.whl
50+
generate_release_notes: true
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.NEXUS_REPO_TOKEN }}

0 commit comments

Comments
 (0)