Skip to content

Commit d5a356b

Browse files
committed
Add release ci #11
1 parent bff824c commit d5a356b

2 files changed

Lines changed: 67 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
defaults:
9+
run:
10+
# make sure to work on Windows
11+
shell: bash
12+
13+
jobs:
14+
release-pypi:
15+
name: release-pypi
16+
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
19+
contents: write
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
cache: pip
28+
29+
- name: Check prerelease
30+
id: check_version
31+
run: |
32+
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then
33+
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
34+
else
35+
echo "PREREERELEASE=true" >> $GITHUB_OUTPUT
36+
fi
37+
38+
- name: Setup uv
39+
uses: astral-sh/setup-uv@v1
40+
with:
41+
uv-version: latest
42+
43+
- name: Build artifacts
44+
run: uv build
45+
46+
- name: Upload artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: fit-tool-wheel
50+
path: dist/*.whl
51+
if-no-files-found: error
52+
retention-days: 15
53+
54+
- name: Test Build
55+
run: |
56+
uv pip install "fit-tool @ file://$(ls ${GITHUB_WORKSPACE}/dist/*.whl)"
57+
fittool --help
58+
59+
- name: Publish package distributions to PyPI
60+
uses: pypa/gh-action-pypi-publish@release/v1
61+
62+
- name: Create Release
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
prerelease: ${{ steps.check_version.outputs.PRERELEASE }}
66+
generate_release_notes: true

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "fit-tool"
6+
name = "fit-tool-ng"
77
version = "0.9.13"
88
description = "A library for reading and writing Garmin FIT files."
99
readme = "README.md"

0 commit comments

Comments
 (0)