Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
XFY9326 committed Feb 23, 2024
1 parent 847c611 commit 5ba522d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install pytest hatch versioningit
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build dist
run: |
hatch build
- name: Test with pytest
run: |
pytest ./tests/
- name: Upload release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: XFY9326/PyNdef
slug: XFY9326/PyNdef
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"

[project]
name = "pyndef"
version = "1.0.0"
dynamic = ["version"]
requires-python = ">=3.6"
authors = [
{ name = "XFY9326" }
Expand Down Expand Up @@ -36,4 +36,4 @@ pythonpath = "src"
exclude = [".github/"]

[tool.hatch.version]
path = "src/pyndef/__about__.py"
source = "versioningit"

0 comments on commit 5ba522d

Please sign in to comment.