Skip to content

Commit 695717a

Browse files
authored
ci: add PyPI publishing workflow and release-please config (#10)
1 parent 3a6a175 commit 695717a

6 files changed

Lines changed: 143 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish Pypi Package
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
name: Build distribution
12+
13+
steps:
14+
- name: Cloning repo
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up uv
20+
uses: astral-sh/setup-uv@v7
21+
with:
22+
enable-cache: true
23+
24+
- name: Build binary wheel and a source tarball
25+
run: make build
26+
27+
- name: Upload distribution artifacts
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: dist
31+
path: dist/
32+
33+
publish:
34+
runs-on: ubuntu-latest
35+
name: Publish to PyPI
36+
needs: build
37+
environment: pypi
38+
permissions:
39+
id-token: write
40+
contents: write
41+
42+
steps:
43+
- name: Download distribution artifacts
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: dist
47+
path: dist/
48+
49+
- name: Publish Package to Pypi
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
52+
- name: Upload dist to GitHub release
53+
env:
54+
GH_TOKEN: ${{ github.token }}
55+
run: gh release upload "${{ github.ref_name }}" dist/* --repo "${{ github.repository }}"

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

LICENSE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright (c) 2026 Bullet Train Ltd (https://www.flagsmith.com/) and individual contributors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4+
following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
13+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
16+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
17+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
18+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ test: ## Run unit tests. Override scope with opts, e.g. `make test opts='-m engi
2121
typecheck: ## Run mypy
2222
uv run mypy
2323

24+
.PHONY: build
25+
build: ## Build the sdist and wheel into dist/
26+
uv build
27+
2428
.PHONY: help
2529
help:
2630
@echo "Usage: make [target]"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "flagsmith-sql-flag-engine"
3-
version = "0.1.0a2"
3+
version = "0.1.0"
44
description = "SQL translator for Flagsmith segment predicates."
55
readme = "README.md"
66
authors = [{ name = "Flagsmith", email = "engineering@flagsmith.com" }]

release-please-config.json

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

0 commit comments

Comments
 (0)