Skip to content
Closed
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
64 changes: 40 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
needs:
- test
concurrency: release
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
permissions:
contents: write
issues: write
Expand All @@ -69,27 +69,43 @@ jobs:
packages: write
environment:
name: release

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v9.14.0
with:
github_token: ${{ secrets.DEPLOY_KEY }}

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.2

# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@v8.7.0
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.DEPLOY_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Check out the target branch
run: git checkout Lash-L-patch-19
- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@v9.14.0
with:
github_token: ${{ secrets.GH_TOKEN }}
push: false
- name: Install GitHub CLI
run: |
sudo apt update
sudo apt install -y gh
- name: Authenticate GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh auth status
- name: Create Merge Request
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh pr create \
--base main \
--head "$RELEASE_BRANCH" \
--title "Release $(python-semantic-release version)" \
--body "This PR contains the release changes for version $(python-semantic-release version --noop)."
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@v1.12.2
# if: steps.release.outputs.released == 'true'
# - name: Publish package distributions to GitHub Releases
# uses: python-semantic-release/upload-to-gh-release@v8.7.0
# if: steps.release.outputs.released == 'true'
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ codespell = "*"
pyshark = "^0.6"

[tool.semantic_release]
branch = "main"
version_toml = ["pyproject.toml:tool.poetry.version"]
build_command = "pip install poetry && poetry build"
[tool.semantic_release.commit_parser_options]
Expand All @@ -59,6 +58,14 @@ allowed_tags = [
"refactor"
]
major_tags= ["refactor"]
[semantic_release.branches.main]
match = "release"
prerelease = false

[tool.semantic_release.branches.other]
match = ".*"
prerelease_token = "rc"
prerelease = true

[tool.ruff]
ignore = ["F403", "E741"]
Expand Down
Loading