-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup release workflow, update readme
- Loading branch information
1 parent
9aac9da
commit b89dd34
Showing
8 changed files
with
54 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ mypy.ini | |
.gitignore | ||
.gitlab-ci.yml | ||
.python-version | ||
README.md | ||
.hooks | ||
.lets | ||
helm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
name: Build & publish | ||
|
||
# TODO: Setup release workflow | ||
on: | ||
push: | ||
branches: [ "**" ] | ||
tags: | ||
- "v*" | ||
# pull_request: | ||
# branches: [main] | ||
|
||
jobs: | ||
deploy-client: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/client-') | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
strategy: | ||
matrix: | ||
python-version: [3.7] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python with PDM ${{ matrix.python-version }} | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Upload package to pypi.org | ||
run: pdm publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} | ||
run: pdm publish -u "__token__" -P ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[project] | ||
name = "evo-featureflags-client" | ||
version = "0.4.0" | ||
dynamic = ["version"] | ||
description = "Feature flags client" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "d.zakharchuk", email = "[email protected]" }, | ||
{ name = "m.kindritskiy", email = "[email protected]" }, | ||
|
@@ -27,7 +28,12 @@ build-backend = "pdm.backend" | |
|
||
[tool.pdm] | ||
|
||
[tool.pdm.version] | ||
source = "file" | ||
path = "featureflags_client/__init__.py" | ||
|
||
[tool.pdm.scripts] | ||
release = "./scripts/release.sh" | ||
ishell = "ptpython --asyncio --dark-bg --history-file=.ptpython {args}" | ||
test = "python -m pytest {args}" | ||
docs = "sphinx-build -a -b html docs public" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -e | ||
USAGE="Usage: VERSION=<> MESSAGE=<> pdm run release" | ||
|
||
if [ -z "${VERSION}" ]; then | ||
echo "$USAGE" | ||
echo "VERSION is not set" | ||
exit 1 | ||
fi | ||
if [ -z "${MESSAGE}" ]; then | ||
echo "$USAGE" | ||
echo "MESSAGE is not set" | ||
exit 1 | ||
fi | ||
|
||
echo "Releasing ${VERSION} with message: ${MESSAGE}" | ||
|
||
echo "__version__ = \"${VERSION}\"" > featureflags_client/__init__.py | ||
git add featureflags_client/__init__.py | ||
git commit -m "Release ${VERSION}" | ||
|
||
git tag -a v${VERSION} -m "${MESSAGE}" | ||
git push origin main --tags |