-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic versioning and deploy to PyPi
- Loading branch information
1 parent
bd3f8e6
commit 54e7f01
Showing
6 changed files
with
59 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: "Release actions" | ||
|
||
on: | ||
release: | ||
types: ["published"] | ||
|
||
env: | ||
PYTHON_VERSION: "3.x" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
name: Deploy to PyPi | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
- name: "Set version number from tag" | ||
run: | | ||
echo -n '${{ github.ref_name }}' > ./VERSION | ||
sed -i 's/dev/${{ github.ref_name }}/g' ./src/version.ts | ||
cat ./VERSION | ||
cat ./src/version.ts | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install build twine | ||
./script/bootstrap | ||
- name: Build | ||
run: yarn build | ||
|
||
- name: Publish to PyPi | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python -m build | ||
twine upload dist/* |
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,2 +1,3 @@ | ||
graft lcn_frontend | ||
global-exclude *.py[cod] | ||
include VERSION |
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 @@ | ||
dev |
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 |
---|---|---|
|
@@ -4,18 +4,22 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "lcn_frontend" | ||
version = "0.1.0" | ||
license = {text = "MIT License"} | ||
description = "LCN panel for Home Assistant" | ||
keywords = ["Home Assistant", "LCN"] | ||
readme = "README.md" | ||
authors = [ | ||
{name = "Andre Lengwenus", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.10.0" | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/alengwenus/lcn-frontend.git" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {file = "VERSION"} | ||
|
||
[tool.setuptools] | ||
platforms = ["any"] | ||
zip-safe = false | ||
|
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 @@ | ||
export const VERSION = "dev"; |