Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Bump version tag on merge

on:
pull_request:
types: [closed]
branches: [main]

jobs:
tag:
uses: git-mastery/actions/.github/workflows/bump-version.yml@main
secrets: inherit
42 changes: 14 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build and release difflib-parser to PyPi

on:
workflow_run:
workflows:
- Bump version tag on merge
types:
- completed
workflow_dispatch:
push:
tags:
Expand All @@ -13,32 +18,13 @@ permissions:
issues: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
prepare:
uses: git-mastery/actions/.github/workflows/get-latest-tag.yml@main

- name: Run unit tests
run: |
python -m pytest -s -vv

- name: Build binary
run: |
echo "__version__ = \"${GITHUB_REF_NAME}\"" > src/difflib_parser/version.py
python -m build

- name: Publish
run: |
python -m twine upload --username "__token__" --password ${{ secrets.PYPI_TOKEN }} --skip-existing --verbose dist/*
publish:
needs: prepare
uses: git-mastery/actions/.github/workflows/publish-pypi-library.yml@main
with:
library_path: src/difflib_parser
ref_name: ${{ needs.prepare.outputs.ref_name }}
secrets: inherit