Skip to content

Commit

Permalink
ci: release github actions (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergs-pci authored Apr 16, 2024
1 parent 4124c88 commit 0abdf17
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- platform
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: New Features 🎉
labels:
- Semver-Minor
- feature
- title: Other Changes
labels:
- "*"
32 changes: 32 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to Test PyPI
on:
workflow_dispatch:
inputs:
PYTHON_VERSION:
description: "Python Version"
required: false
default: "3.10.13"
POETRY_VERSION:
description: "The version of Poetry to use"
required: false
default: "1.8.2"
defaults:
run:
working-directory: ./tools
jobs:
test_pypi_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pip install poetry==${{ inputs.POETRY_VERSION }}
shell: bash
- name: Set up Python ${{ inputs.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PYTHON_VERSION }}
- run: poetry install
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
- name: Publish package
run: poetry publish --build -r testpypi
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish to PyPI
on:
workflow_dispatch:
inputs:
PYTHON_VERSION:
description: "Python Version"
required: false
default: "3.10.13"
POETRY_VERSION:
description: "The version of Poetry to use"
required: false
default: "1.8.2"
RELEASE_TAG:
description: "The new version should be a valid PEP 440 string"
required: true
default: "0.0.1"
defaults:
run:
working-directory: ./tools
jobs:
pypi_release:
name: Builds Using Poetry and Publishes to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pip install poetry==${{ inputs.POETRY_VERSION }}
shell: bash
- name: Set up Python ${{ inputs.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PYTHON_VERSION }}
- name: Add and Commit Version
run: |
poetry version ${{ inputs.RELEASE_TAG }}
git add ./pyproject.toml
git config --global user.name "Release Bot"
git config --global user.email "[email protected]"
git commit -m "Change version to ${{ inputs.RELEASE_TAG }}" --allow-empty
git push origin
shell: bash
- run: poetry install
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}"
- name: Publish package
run: poetry publish --build
- name: Build binary
run: poetry run build
- uses: ncipollo/release-action@v1
with:
artifacts: "tools/dist/cgdevxcli"
generateReleaseNotes: true
commit: main
tag: ${{ inputs.RELEASE_TAG }}

0 comments on commit 0abdf17

Please sign in to comment.