Skip to content

Commit

Permalink
chore: CI Switch to go-semantic-release 🔧👷
Browse files Browse the repository at this point in the history
  • Loading branch information
guisea committed Nov 22, 2024
1 parent af546dd commit 1d6f188
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 35 deletions.
42 changes: 9 additions & 33 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,20 @@ jobs:
python-version: ${{ matrix.python-version }}
# cache: "poetry"
- name: Install dependencies
run: pip install poetry && poetry install
- uses: python-semantic-release/python-semantic-release@v9.12.0
with:
root_options: "-vv --noop"
run: |
pip install poetry && \
poetry install
- name: Action | Semantic Version Release
id: release
# Adjust tag with desired version if applicable.
uses: python-semantic-release/python-semantic-release@v9.12.0
id: semrelease
uses: go-semantic-release/action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "actions@users.noreply.github.com"
hooks: exec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
if: steps.release.outputs.released == 'true'

# ## Because inside the poetry venv?
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}
# # repository_url: https://test.pypi.org/legacy/
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v9.8.9
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.github_token }}
tag: ${{ steps.release.outputs.tag }}

# - name: Upload to GH
# env:
# GH_TOKEN: ${{ secrets.github_token }}
# run: |
# git config user.name github-actions
# git config user.email github-actions@github.com
# semantic-release publish
22 changes: 22 additions & 0 deletions .semrelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"plugins": {
"provider": {
"name": "github"
},
"changelog-generator": {
"name": "default",
"options": {
"emojis": "true"
}
},
"hooks": {
"names": [
"exec"
],
"options": {
"exec_on_success": "./scripts/build.sh {{.NewRelease.Version}}",
"exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
}
}
}
}
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tool.poetry]
name = "certbot_dns_directadmin"
#version = "1.0.7"
version = "0.0.0-dev"
description = "Certbot plugin. Allows completing DNS01 challenge against a DirectAdmin Server"
authors = ["guisea <hey@cybercinch.nz>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.9"
Expand Down
14 changes: 14 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Update version for the release
sed -ie "s/^version = \".*\"/version = \"${1}\"/" pyproject.toml

# Ensure no complaints about drift.
poetry lock --no-update

# Build the package
poetry build
## Configure credentials
#poetry config pypi-token.pypi "${PYPI_TOKEN}"
## Publish package up to PyPi
#poetry publish

0 comments on commit 1d6f188

Please sign in to comment.