Skip to content
Open
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
59 changes: 26 additions & 33 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,6 @@ on:
branches:
- main
jobs:
test_publish:
name: "Test publishing"
runs-on: "ubuntu-latest"
needs: [test, lint]
environment:
name: testpypi
url: https://test.pypi.org/p/devto
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Sync environment
run: uv sync
- name: Prepare package for release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.12.3
with:
repository_url: https://test.pypi.org/legacy/
github-release:
needs:
- publish
Expand Down Expand Up @@ -79,7 +48,7 @@ jobs:
name: "Publish to Pypi"
runs-on: "ubuntu-latest"
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test, lint]
needs: [bump_version, test, lint]
permissions:
id-token: write
contents: write
Expand All @@ -102,7 +71,31 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository_url: https://pypi.org/legacy/

bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: develop
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "CHANGELOG.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
strategy:
matrix:
Expand Down
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# CHANGELOG
## 0.1.5 (2025-01-05)

### Fix

## v0.1.2 (2025-01-05)
* Test version
- **workflow**: Attempts to fix the workflow
- **workflow**: Fix pypi publishing
- **workflow**: fixes workflow
- **workflow**: Attempt to make release

## v0.1.2 (2025-01-05)
* Test version
## v0.1.1 (2025-01-05)

### Fix

- **workflow**: modify workflow

## v0.1.0 (2025-01-05)

## v0.0.0 (2025-01-05)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ At the moment, functionality only allows one to query articles and publish/updat
Currently there are no Pypi wheels, use

```bash
pip install git+https://github.com/AlejandroGomezFrieiro/devto_py.git
pip install devto
```

## Usage
Expand Down
10 changes: 6 additions & 4 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
...
}: {
packages = [
pkgs.git
pkgs.act
pkgs.git
pkgs.act
pkgs.commitizen
];
languages.python.enable = true;
languages.python.uv.enable = true;
Expand All @@ -16,12 +17,13 @@
languages.python.venv.enable = true;

scripts.build.exec = ''
uv build
uv build
'';

pre-commit = {
hooks = {
# mypy.enable = true;
alejandra.enable = true;
commitizen.enable = true;
ruff.enable = true;
ruff-format.enable = true;
};
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
systems = nixpkgs.lib.systems.flakeExposed;
flake = {
build = nixpkgs.writeScriptBin "build" ''
uv build
'';
uv build
'';
};
perSystem = {
config,
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "devto"
version = "0.1.3"
# dynamic = ["version"]
# version = "0.1.5"
dynamic = ["version"]
description = "Modern Dev.To API client built with aiohttp and pydantic"
readme = "README.md"
requires-python = ">=3.12"
Expand All @@ -13,6 +13,12 @@ dependencies = [
"pydantic>=2.10.4",
]

[tool.commitizen]
name = "cz_conventional_commits"
version = "0.1.5"
version_files = [
"pyproject.toml:version",
]
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
Expand All @@ -24,6 +30,7 @@ dev = [
"mypy>=1.14.1",
"isort>=5.13.2",
"types-requests>=2.32.0.20241016",
"commitizen>=4.1.0",
]
test = [
"pytest-cov>=6.0.0",
Expand Down
Loading