File tree Expand file tree Collapse file tree 6 files changed +18
-14
lines changed Expand file tree Collapse file tree 6 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,11 @@ name: Build and Release
33on :
44 push :
55 tags :
6- - ' v*.*.*' # This will trigger the workflow on version tags, e.g., v1.0.0
6+ - ' v*.*.*'
77
88jobs :
99 build :
1010 runs-on : ubuntu-latest
11- permissions :
12- contents : write
1311
1412 steps :
1513 - name : Checkout code
@@ -18,21 +16,21 @@ jobs:
1816 - name : Set up Python
1917 uses : actions/setup-python@v2
2018 with :
21- python-version : ' 3.8' # Specify your Python version
19+ python-version : ' 3.8'
20+
21+ - name : Get version from tag
22+ id : vars
23+ run : echo "VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV"
2224
2325 - name : Install dependencies
2426 run : |
2527 python -m pip install --upgrade pip
26- pip install setuptools wheel
28+ pip install setuptools wheel setuptools-scm
2729
2830 - name : Build package
2931 run : |
3032 python setup.py sdist bdist_wheel
3133
32- - name : " Build Changelog"
33- id : build_changelog
34- uses : mikepenz/release-changelog-builder-action@v5
35-
3634 - name : Upload Package to Release
3735 uses : softprops/action-gh-release@v1
3836 with :
Original file line number Diff line number Diff line change 33import json
44import os
55import subprocess
6+ from importlib .metadata import version
67
8+
9+ app_version = version ('py-config-gs' )
710# Configure logging
811logging .basicConfig (level = logging .DEBUG , # Set the log level to DEBUG
912 format = '%(asctime)s - %(levelname)s - %(message)s' )
@@ -61,7 +64,7 @@ def stream():
6164
6265@app .route ('/' )
6366def home ():
64- return render_template ('home.html' , config_files = config_files )
67+ return render_template ('home.html' , config_files = config_files , version = app_version )
6568
6669@app .route ('/edit/<filename>' , methods = ['GET' , 'POST' ])
6770def edit (filename ):
Original file line number Diff line number Diff line change 11<!-- templates/footer.html -->
22< footer >
3- < p > © 2024 PyConfig Groundstation</ p >
3+ < p > © 2024 PyConfig Groundstation, version: {{ version }} </ p >
44</ footer >
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ itsdangerous==2.2.0
66jinja2 == 3.1.4
77MarkupSafe == 2.1.5
88werkzeug == 3.0.4
9- zipp == 3.20.2
9+ zipp == 3.20.2
10+ setuptools-scm == 8.1.0
Original file line number Diff line number Diff line change 11import os
2- from setuptools import setup , find_packages
2+ from setuptools import setup , find_packages , setuptools_scm
33
44# Define the relative path for the settings file and systemd service file
55settings_file = 'py_config_gs/settings.json' # Ensure this is a relative path
66service_file = 'py_config_gs/systemd/py-config-gs.service' # Ensure this is a relative path
77
88setup (
99 name = 'py-config-gs' ,
10- version = '0.1' ,
10+ use_scm_version = True , # This tells setuptools to use scm for version
11+ setup_requires = ['setuptools_scm' ],
1112 packages = find_packages (),
1213 include_package_data = True , # Include files from MANIFEST.in
1314 install_requires = [
2122 'MarkupSafe==2.1.5' ,
2223 'werkzeug==3.0.4' ,
2324 'zipp==3.20.2' ,
25+ 'setuptools-scm==8.1.0'
2426 ],
2527 entry_points = {
2628 'console_scripts' : [
You can’t perform that action at this time.
0 commit comments