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
46 changes: 13 additions & 33 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build and release repo-smith to PyPi

on:
workflow_run:
workflows:
- Bump version tag on merge
types:
- completed
workflow_dispatch:
push:
tags:
Expand All @@ -13,37 +18,12 @@ 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: Setup Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
prepare:
uses: git-mastery/actions/.github/workflows/get-latest-tag.yml@main

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

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

- name: Build binary
run: |
echo "__version__ = \"${GITHUB_REF_NAME}\"" > src/repo_smith/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/repo_smith
ref_name: ${{ needs.prepare.outputs.ref_name }}