Skip to content

Commit

Permalink
GHA: edit in version during build
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed May 20, 2024
1 parent 3ac941e commit 3adbe1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ jobs:
- name: List Pip modules
run: ./venv/bin/pip list

- name: Compile binary
- name: Prepare script with version
run: |
echo "Building with version ${GITHUB_REF#refs/tags/}"
export APP_VERSION=${GITHUB_REF#refs/tags/}
./venv/bin/python -m nuitka sb.py --onefile -o sb && chmod +x sb
sed "s/__version__ = \"0.0.0\"/__version__ = \"${GITHUB_REF#refs/tags/}\"/" sb.py > sb_with_version.py
- name: Debug
run: cat sb_with_version.py

- name: Compile binary
run: ./venv/bin/python -m nuitka sb_with_version.py --onefile -o sb && chmod +x sb

- name: Release
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 1 addition & 1 deletion release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
refs/tags/v1.0.1
refs/tags/v1.0.2
2 changes: 1 addition & 1 deletion sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# SB
SB_REPO_PATH = "/srv/git/sb"

__version__ = os.getenv("APP_VERSION", "0.0.0")
__version__ = "0.0.0"

################################
# Functions
Expand Down

0 comments on commit 3adbe1e

Please sign in to comment.