Skip to content

Commit

Permalink
Merge pull request #5 from Tranquility2/release
Browse files Browse the repository at this point in the history
Update release process
  • Loading branch information
Tranquility2 authored Apr 8, 2024
2 parents e69cd47 + 863e947 commit d1fc1b1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[release]'
- name: Bump Version
id: bump_version
env:
BUMP_TYPE: ${{ github.event.inputs.bump_type }}
run: |
python -m pip install semvergit
echo "Bumping type: ${{ env.BUMP_TYPE }}"
new_version=$(semvergit -t ${{ env.BUMP_TYPE }} -v)
new_version=$(python -m semvergit -t ${{ env.BUMP_TYPE }} -v)
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- name: Create Github Release
Expand All @@ -67,12 +71,12 @@ jobs:
- name: Build Package
if: ${{ github.event.inputs.publish == 'true' }}
run: |
make build
python -m build
- name: Publish To PyPI
if: ${{ github.event.inputs.publish == 'true' }}
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: ${{ secrets.PYPI_API_USER }}
run: |
make publish
python -m twine upload dist/*
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ run:
python3 xls_updater/app.py

setup:
python3 -m pip install --editable '.[dev,test]'
python3 -m pip install '.[dev, test, release]'

setup-dev:
python3 -m pip install --editable '.[dev]'

setup-test:
python3 -m pip install --editable '.[test]'

setup-relase:
python3 -m pip install --editable '.[release]'

pip-clean:
python3 -m pip uninstall -y -r <(pip freeze)

Expand Down Expand Up @@ -51,11 +54,3 @@ compile:
python3 -m pip install --upgrade pip-tools
python3 -m piptools compile -o requirements-dev.txt --extra dev pyproject.toml
python3 -m piptools compile -o requirements-test.txt --extra test pyproject.toml

build:
python3 -m pip install --upgrade build
python3 -m build

publish:
python3 -m pip install --upgrade twine
python3 -m twine upload dist/*
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ test = [
"pytest-cov",
"pytest_mock",
]
release = [
"semvergit",
"build",
"twine",
]

[project.scripts]
xls-updater = "xls_updater.cli:cli"
Expand Down

0 comments on commit d1fc1b1

Please sign in to comment.