Skip to content

Commit 6fdfe69

Browse files
authored
ci: Add release-please, publish to PyPI (#20)
1 parent 7793949 commit 6fdfe69

File tree

9 files changed

+344
-13
lines changed

9 files changed

+344
-13
lines changed

.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Conventional Commit
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
conventional-commit:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: read # for amannn/action-semantic-pull-request to read PR titles
12+
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
types:
19+
| # mirrors changelog-sections in the /release-please-config.json
20+
chore
21+
ci
22+
deps
23+
docs
24+
feat
25+
fix
26+
perf
27+
refactor
28+
test

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
tag_name: ${{ github.event.release.tag_name || github.ref_name }}
10+
artifact-name: flagsmith-common-${{ github.event.release.tag_name || github.ref_name }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.12
22+
23+
- name: Install Poetry
24+
run: pipx install poetry
25+
26+
- name: Build Package
27+
run: poetry build
28+
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: ${{ env.artifact-name }}
32+
path: dist/
33+
34+
- uses: softprops/action-gh-release@v2
35+
with:
36+
tag_name: ${{ env.tag_name }}
37+
files: dist/*
38+
39+
publish:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
43+
permissions:
44+
id-token: write # for pypa/gh-action-pypi-publish to authenticate with PyPI
45+
46+
steps:
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: ${{ env.artifact-name }}
50+
path: dist/
51+
52+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/linting-and-formatting.yml renamed to .github/workflows/python-test.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
name: Python Checks and Unit Tests
1+
name: Python Checks and Unit Tests
22

33
on:
44
pull_request:
55

66
jobs:
7-
test:
7+
lint-test:
88
runs-on: ubuntu-latest
9-
name: Python Checks and Unit Tests
109

11-
steps:
12-
- name: Cloning repo
13-
uses: actions/checkout@v3
10+
strategy:
11+
max-parallel: 2
12+
matrix:
13+
python-version: ["3.11", "3.12"]
1414

15-
- name: Install poetry
16-
run: pipx install poetry
15+
steps:
16+
- uses: actions/checkout@v4
1717

1818
- uses: actions/setup-python@v4
1919
with:
20-
python-version: 3.12
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install Poetry
23+
run: pipx install poetry
2124

2225
- name: Install Dependencies
2326
run: poetry install --with dev
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # for googleapis/release-please-action to create release commit
13+
pull-requests: write # for googleapis/release-please-action to create release PR
14+
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
id: release
18+
with:
19+
token: ${{secrets.RELEASE_PLEASE_GITHUB_TOKEN}}
20+
21+
outputs:
22+
release_created: ${{ steps.release.outputs.release_created }}
23+
release_tag_name: ${{ steps.release.outputs.tag_name }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*.pyc
55
.coverage
66
common.sqlite3
7+
dist/

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ repos:
1313
hooks:
1414
- id: poetry-check
1515
- id: poetry-lock
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v5.0.0
18+
hooks:
19+
- id: check-yaml
20+
- id: check-json
21+
- id: check-toml
1622
- repo: local
1723
hooks:
1824
- id: python-typecheck

CHANGELOG.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Changelog
2+
3+
<a name="v1.5.2"></a>
4+
5+
## [v1.5.2](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.5.2) - 25 Mar 2025
6+
7+
### What's Changed
8+
9+
- fix: Liveness probe performs database queries by [@khvn26](https://github.com/khvn26) in https://github.com/Flagsmith/flagsmith-common/pull/19
10+
11+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.5.1...v1.5.2
12+
13+
[Changes][v1.5.2]
14+
15+
<a name="v1.5.1"></a>
16+
17+
## [v1.5.1](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.5.1) - 25 Mar 2025
18+
19+
### What's Changed
20+
21+
- fix: Rule is asserted in `SegmentSerializer` when `segment` is not `None` by [@khvn26](https://github.com/khvn26) in https://github.com/Flagsmith/flagsmith-common/pull/18
22+
23+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.5.0...v1.5.1
24+
25+
[Changes][v1.5.1]
26+
27+
<a name="v1.5.0"></a>
28+
29+
## [v1.5.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.5.0) - 25 Mar 2025
30+
31+
### What's Changed
32+
33+
- feat: Add `version_of` to rules and conditions serializers by [@zachaysan](https://github.com/zachaysan) in https://github.com/Flagsmith/flagsmith-common/pull/11
34+
- feat: Add healthcheck views + urls, typing, ruff linting, src layout by [@khvn26](https://github.com/khvn26) in https://github.com/Flagsmith/flagsmith-common/pull/13
35+
- feat: Prometheus support, core entrypoint, packaging improvements by [@khvn26](https://github.com/khvn26) and [@rolodato](https://github.com/rolodato) in https://github.com/Flagsmith/flagsmith-common/pull/17
36+
- feat: Add `MANAGE_SEGMENT_OVERRIDES` permission by [@francescolofranco](https://github.com/francescolofranco) in https://github.com/Flagsmith/flagsmith-common/pull/14
37+
- feat: Add Makefile for development setup and installation instructions by [@francescolofranco](https://github.com/francescolofranco) in https://github.com/Flagsmith/flagsmith-common/pull/15
38+
- fix: Clarify change request wording by [@zachaysan](https://github.com/zachaysan) in https://github.com/Flagsmith/flagsmith-common/pull/10
39+
- fix: Handle missing condition by [@zachaysan](https://github.com/zachaysan) in https://github.com/Flagsmith/flagsmith-common/pull/12
40+
- fix: `self_hosted_data` is cached indefinitely by [@khvn26](https://github.com/khvn26) in https://github.com/Flagsmith/flagsmith-common/pull/16
41+
42+
### New Contributors
43+
44+
- [@francescolofranco](https://github.com/francescolofranco) made their first contribution in https://github.com/Flagsmith/flagsmith-common/pull/15
45+
- [@rolodato](https://github.com/rolodato) made their first contribution in https://github.com/Flagsmith/flagsmith-common/pull/17
46+
47+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.2...v1.5.0
48+
49+
[Changes][v1.5.0]
50+
51+
<a name="v1.4.2"></a>
52+
53+
## [v1.4.2](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.4.2) - 04 Dec 2024
54+
55+
### What's Changed
56+
57+
- fix: segment limit validation versioning by [@matthewelwell](https://github.com/matthewelwell) in https://github.com/Flagsmith/flagsmith-common/pull/9
58+
59+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.1...v1.4.2
60+
61+
[Changes][v1.4.2]
62+
63+
<a name="v1.4.1"></a>
64+
65+
## [v1.4.1](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.4.1) - 04 Dec 2024
66+
67+
### What's Changed
68+
69+
- fix: segment limit validation versioning by [@matthewelwell](https://github.com/matthewelwell) in https://github.com/Flagsmith/flagsmith-common/pull/8
70+
71+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.0...v1.4.1
72+
73+
[Changes][v1.4.1]
74+
75+
<a name="v1.4.0"></a>
76+
77+
## [v1.4.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.4.0) - 04 Dec 2024
78+
79+
### What's Changed
80+
81+
- feat(org/permissions): Add org permission constants by [@gagantrivedi](https://github.com/gagantrivedi) in https://github.com/Flagsmith/flagsmith-common/pull/7
82+
83+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.3.0...v1.4.0
84+
85+
[Changes][v1.4.0]
86+
87+
<a name="v1.3.0"></a>
88+
89+
## [v1.3.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.3.0) - 03 Dec 2024
90+
91+
### What's Changed
92+
93+
- fix: Ensure owning segment matches to parent segment from rule or condition by [@zachaysan](https://github.com/zachaysan) in https://github.com/Flagsmith/flagsmith-common/pull/5
94+
95+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.2.0...v1.3.0
96+
97+
[Changes][v1.3.0]
98+
99+
<a name="v1.2.0"></a>
100+
101+
## [v1.2.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.2.0) - 05 Nov 2024
102+
103+
### What's Changed
104+
105+
- feat(env/perms): add cr related perms to tag_supported_permissions by [@gagantrivedi](https://github.com/gagantrivedi) in https://github.com/Flagsmith/flagsmith-common/pull/6
106+
107+
### New Contributors
108+
109+
- [@gagantrivedi](https://github.com/gagantrivedi) made their first contribution in https://github.com/Flagsmith/flagsmith-common/pull/6
110+
111+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.1.0...v1.2.0
112+
113+
[Changes][v1.2.0]
114+
115+
<a name="v1.1.0"></a>
116+
117+
## [v1.1.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.1.0) - 23 Oct 2024
118+
119+
### What's Changed
120+
121+
- chore: add configuration files by [@matthewelwell](https://github.com/matthewelwell) in https://github.com/Flagsmith/flagsmith-common/pull/2
122+
- deps: lock to django 4 by [@matthewelwell](https://github.com/matthewelwell) in https://github.com/Flagsmith/flagsmith-common/pull/3
123+
- feat: Add workflows change request concerns by [@zachaysan](https://github.com/zachaysan) in https://github.com/Flagsmith/flagsmith-common/pull/4
124+
125+
### New Contributors
126+
127+
- [@zachaysan](https://github.com/zachaysan) made their first contribution in https://github.com/Flagsmith/flagsmith-common/pull/4
128+
129+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/compare/v1.0.0...v1.1.0
130+
131+
[Changes][v1.1.0]
132+
133+
<a name="v1.0.0"></a>
134+
135+
## [v1.0.0](https://github.com/Flagsmith/flagsmith-common/releases/tag/v1.0.0) - 18 Jul 2024
136+
137+
### What's Changed
138+
139+
- feat: add serializers for versioning change requests by [@matthewelwell](https://github.com/matthewelwell) in https://github.com/Flagsmith/flagsmith-common/pull/1
140+
141+
### New Contributors
142+
143+
- [@matthewelwell](https://github.com/matthewelwell) made their first contribution in https://github.com/Flagsmith/flagsmith-common/pull/1
144+
145+
**Full Changelog**: https://github.com/Flagsmith/flagsmith-common/commits/v1.0.0
146+
147+
[Changes][v1.0.0]
148+
149+
[v1.5.2]: https://github.com/Flagsmith/flagsmith-common/compare/v1.5.1...v1.5.2
150+
[v1.5.1]: https://github.com/Flagsmith/flagsmith-common/compare/v1.5.0...v1.5.1
151+
[v1.5.0]: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.2...v1.5.0
152+
[v1.4.2]: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.1...v1.4.2
153+
[v1.4.1]: https://github.com/Flagsmith/flagsmith-common/compare/v1.4.0...v1.4.1
154+
[v1.4.0]: https://github.com/Flagsmith/flagsmith-common/compare/v1.3.0...v1.4.0
155+
[v1.3.0]: https://github.com/Flagsmith/flagsmith-common/compare/v1.2.0...v1.3.0
156+
[v1.2.0]: https://github.com/Flagsmith/flagsmith-common/compare/v1.1.0...v1.2.0
157+
[v1.1.0]: https://github.com/Flagsmith/flagsmith-common/compare/v1.0.0...v1.1.0
158+
[v1.0.0]: https://github.com/Flagsmith/flagsmith-common/tree/v1.0.0
159+
160+
<!-- Generated by https://github.com/rhysd/changelog-from-release v3.7.2 -->

release-please-config.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bootstrap-sha": "77939497c31701d6c1eb49fdbec810134254fb58",
4+
"packages": {
5+
".": {
6+
"bump-minor-pre-major": false,
7+
"bump-patch-for-minor-pre-major": false,
8+
"changelog-path": "CHANGELOG.md",
9+
"draft": false,
10+
"include-component-in-tag": false,
11+
"prerelease": false,
12+
"release-type": "python"
13+
}
14+
},
15+
"changelog-sections": [
16+
{
17+
"type": "chore",
18+
"hidden": false,
19+
"section": "Other"
20+
},
21+
{
22+
"type": "ci",
23+
"hidden": false,
24+
"section": "CI"
25+
},
26+
{
27+
"type": "deps",
28+
"hidden": false,
29+
"section": "Dependency Updates"
30+
},
31+
{
32+
"type": "docs",
33+
"hidden": false,
34+
"section": "Docs"
35+
},
36+
{
37+
"type": "feat",
38+
"hidden": false,
39+
"section": "Features"
40+
},
41+
{
42+
"type": "fix",
43+
"hidden": false,
44+
"section": "Bug Fixes"
45+
},
46+
{
47+
"type": "perf",
48+
"hidden": false,
49+
"section": "Performance Improvements"
50+
},
51+
{
52+
"type": "refactor",
53+
"hidden": false,
54+
"section": "Refactoring"
55+
},
56+
{
57+
"type": "test",
58+
"hidden": false,
59+
"section": "Tests"
60+
}
61+
]
62+
}

0 commit comments

Comments
 (0)