diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7b5ad19..c3ca18f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,8 +3,8 @@ on: push: pull_request: permissions: - contents: read - pull-requests: read + contents: read|write + pull-requests: read|write jobs: build: runs-on: ubuntu-latest @@ -21,5 +21,13 @@ jobs: run: nim release - name: 'Install Figlet' run: sudo apt-get install figlet - - name: 'Test Catnip' + - name: 'Run Tests' run: cd tests && ./test.sh + - name: 'Add build Number' + run: echo 'const BUILDNUMBER = "${{ github.run_id }}"' > ./src/catniplib/global/buildnum.nim + - name: 'Push build Number' + run: | + git config --global user.name 'iinsertNameHere' + git config --global user.email 'iinsertNameHere@users.noreply.github.com' + git commit -am "Automatic build Number update" + git push diff --git a/src/catnip.nim b/src/catnip.nim index 7b8f781..9768cce 100644 --- a/src/catnip.nim +++ b/src/catnip.nim @@ -9,8 +9,8 @@ from unicode import toLower import strutils import strformat import std/wordwrap - import "catniplib/platform/probe" +from "catniplib/global/buildnum" import BUILDNUMBER # Debug code for execution time when not defined release: @@ -49,6 +49,8 @@ proc printHelp(cfg: Config) = echo "DistroIds:" echo " " & cfg.getAllDistros().join(", ").wrapWords(80).replace("\n", "\n ") echo "" + echo "Catnip - Build " & BUILDNUMBER + echo "" quit() # Handle commandline args diff --git a/src/catniplib/global/buildnum.nim b/src/catniplib/global/buildnum.nim new file mode 100644 index 0000000..53b73bf --- /dev/null +++ b/src/catniplib/global/buildnum.nim @@ -0,0 +1 @@ +const BUILDNUMBER* = "N/A" \ No newline at end of file