mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-05-12 12:00:13 +00:00
Add version calculation and separate label vs. commit
This slightly changes how the versioning works.
This commit is contained in:
parent
d928ab2c8b
commit
7be379c39d
30
.ci/calculate_version.sh
Executable file
30
.ci/calculate_version.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
echo "-nongit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LAST_TAG=$(git describe --tags --abbrev=0 HEAD)
|
||||
COMMIT_COUNT=$(git rev-list $LAST_TAG.. --count)
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
git diff --no-ext-diff --quiet --exit-code
|
||||
DIRTY=$?
|
||||
|
||||
VERSION=
|
||||
|
||||
if [ "$COMMIT_COUNT" != "0" ]; then
|
||||
VERSION+="-$COMMIT_COUNT-$COMMIT_HASH"
|
||||
fi
|
||||
|
||||
if [ "$DIRTY" != "0" ]; then
|
||||
VERSION+="-dirty"
|
||||
fi
|
||||
|
||||
if [ ! -z "$VERSION" ]; then
|
||||
echo "Version label: $VERSION"
|
||||
echo "$VERSION" > ./internal/version.txt
|
||||
else
|
||||
echo "Release version!"
|
||||
rm -f ./internal/version.txt
|
||||
fi
|
|
@ -1,7 +1,6 @@
|
|||
@ECHO OFF
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
|
||||
echo From git %GITHUB_SHA:~0,7% > internal\version.txt
|
||||
qb64_bootstrap.exe -z source\qb64.bas
|
||||
cd internal\c
|
||||
c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64.exe"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo From git `echo $GITHUB_SHA | sed 's/\(.......\).*$/\1/'` > internal/version.txt
|
||||
./qb64_bootstrap -x -w source/qb64.bas
|
||||
SUCCESS=$?
|
||||
rm qb64_bootstrap
|
||||
|
|
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
|
@ -6,42 +6,67 @@ jobs:
|
|||
linux-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Calculate Version
|
||||
run: .ci/calculate_version.sh
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh lnx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Print QB64 Version
|
||||
run: ./qb64 -?
|
||||
|
||||
macos-build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Calculate Version
|
||||
run: .ci/calculate_version.sh
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh osx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Print QB64 Version
|
||||
run: ./qb64 -?
|
||||
|
||||
windows-x86-build:
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
PLATFORM: x86
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Calculate Version
|
||||
shell: bash
|
||||
run: .ci/calculate_version.sh
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
- name: Print QB64 Version
|
||||
run: ./qb64 -?
|
||||
|
||||
windows-x64-build:
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
PLATFORM: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Calculate Version
|
||||
shell: bash
|
||||
run: .ci/calculate_version.sh
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
|
||||
- name: Print QB64 Version
|
||||
run: ./qb64 -?
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,6 +8,7 @@ internal/config*.txt
|
|||
internal/config.ini
|
||||
internal/help
|
||||
internal/version.txt
|
||||
internal/commit.txt
|
||||
tempfoldersearch.bin
|
||||
internal/c/qbx[2-9].cpp
|
||||
*.ttf
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
DIM SHARED Version AS STRING
|
||||
DIM SHARED DevChannel AS STRING
|
||||
DIM SHARED AutoBuildMsg AS STRING
|
||||
DIM SHARED IsCiVersion AS _BYTE
|
||||
|
||||
Version$ = "2.1"
|
||||
DevChannel$ = "Development Build"
|
||||
Version$ = "2.1.0"
|
||||
|
||||
' If ./internal/version.txt exist, then this is some kind of CI build with a label
|
||||
IF _FILEEXISTS("internal/version.txt") THEN
|
||||
versionfile = FREEFILE
|
||||
OPEN "internal/version.txt" FOR INPUT AS #versionfile
|
||||
LINE INPUT #versionfile, AutoBuildMsg
|
||||
AutoBuildMsg = LEFT$(_TRIM$(AutoBuildMsg), 16) 'From git 1234567
|
||||
IF LEFT$(AutoBuildMsg, 9) <> "From git " THEN AutoBuildMsg = ""
|
||||
|
||||
LINE INPUT #versionfile, VersionLabel$
|
||||
Version$ = Version$ + VersionLabel$
|
||||
|
||||
if VersionLabel$ <> "" then
|
||||
IsCiVersion = -1
|
||||
end if
|
||||
|
||||
CLOSE #versionfile
|
||||
END IF
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ FUNCTION ide2 (ignore)
|
|||
IF _ERRORLINE > 0 OR _INCLERRORLINE > 0 THEN
|
||||
ideerrormessageTITLE$ = ideerrormessageTITLE$ + str2$(_ERRORLINE) + "-" + str2$(_INCLERRORLINE)
|
||||
END IF
|
||||
IF LEN(AutoBuildMsg$) THEN ideerrormessageTITLE$ = ideerrormessageTITLE$ + "-" + MID$(AutoBuildMsg$, 10)
|
||||
IF IsCiVersion THEN ideerrormessageTITLE$ = ideerrormessageTITLE$ + "-" + Version$
|
||||
ideerrormessageTITLE$ = ideerrormessageTITLE$ + ")"
|
||||
IF ideerrormessageTITLE$ = "Error ()" THEN ideerrormessageTITLE$ = "Error"
|
||||
IF AttemptToLoadRecent = -1 THEN
|
||||
|
@ -201,11 +201,11 @@ FUNCTION ide2 (ignore)
|
|||
errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(module: " + _
|
||||
RemoveFileExtension$(LEFT$(_INCLERRORFILE$, 60))
|
||||
errorat$ = errorat$ + ", on line: " + str2$(inclerrorline)
|
||||
IF LEN(AutoBuildMsg$) THEN errorat$ = errorat$ + ", " + MID$(AutoBuildMsg$, 10)
|
||||
IF IsCiVersion THEN errorat$ = errorat$ + ", " + Version$
|
||||
errorat$ = errorat$ + ")"
|
||||
ELSE
|
||||
errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(on line: " + str2$(_ERRORLINE)
|
||||
IF LEN(AutoBuildMsg$) THEN errorat$ = errorat$ + ", " + MID$(AutoBuildMsg$, 10)
|
||||
IF IsCiVersion THEN errorat$ = errorat$ + ", " + Version$
|
||||
errorat$ = errorat$ + ")"
|
||||
END IF
|
||||
END IF
|
||||
|
@ -5173,8 +5173,8 @@ FUNCTION ide2 (ignore)
|
|||
IF menu$(m, s) = "#About..." THEN
|
||||
helpabout:
|
||||
PCOPY 2, 0
|
||||
m$ = "QB64 Version " + Version$ + CHR$(10) + DevChannel$
|
||||
IF LEN(AutoBuildMsg$) THEN m$ = m$ + CHR$(10) + AutoBuildMsg$
|
||||
m$ = "QB64 Version " + Version$
|
||||
IF IsCiVersion THEN m$ = m$ + CHR$(10) + "CI Build"
|
||||
result = idemessagebox("About", m$, "")
|
||||
PCOPY 3, 0: SCREEN , , 3, 0
|
||||
GOTO ideloop
|
||||
|
@ -8015,7 +8015,6 @@ SUB DebugMode
|
|||
'print version in the status bar
|
||||
IF LEN(versionStringStatus$) = 0 THEN
|
||||
versionStringStatus$ = " v" + Version$
|
||||
IF LEN(AutoBuildMsg$) THEN versionStringStatus$ = versionStringStatus$ + MID$(AutoBuildMsg$, _INSTRREV(AutoBuildMsg$, " "))
|
||||
versionStringStatus$ = versionStringStatus$ + " "
|
||||
END IF
|
||||
COLOR 2, 3
|
||||
|
@ -15479,8 +15478,7 @@ END FUNCTION 'yes/no box
|
|||
' Result$ = Download$("", "", "", 0)
|
||||
' NEXT
|
||||
|
||||
' m$ = "Current version: " + Version$ + " " + DevChannel$
|
||||
' IF LEN(AutoBuildMsg$) THEN m$ = m$ + ", " + AutoBuildMsg$
|
||||
' m$ = "Current version: " + Version$
|
||||
' m$ = m$ + ".\n"
|
||||
|
||||
' DIM button$(1 TO 3)
|
||||
|
@ -19436,7 +19434,6 @@ SUB UpdateIdeInfo
|
|||
|
||||
IF LEN(versionStringStatus$) = 0 THEN
|
||||
versionStringStatus$ = " v" + Version$
|
||||
IF LEN(AutoBuildMsg$) THEN versionStringStatus$ = versionStringStatus$ + MID$(AutoBuildMsg$, _INSTRREV(AutoBuildMsg$, " "))
|
||||
versionStringStatus$ = versionStringStatus$ + " "
|
||||
END IF
|
||||
'_PRINTSTRING (idewx - 22 - LEN(versionStringStatus$), idewy + idesubwindow), CHR$(179)
|
||||
|
|
|
@ -12462,7 +12462,6 @@ lnx = 0: IF os$ = "LNX" THEN lnx = 1
|
|||
mac = 0: IF MacOSX THEN mac = 1: o$ = "osx"
|
||||
defines$ = "": defines_header$ = " -D "
|
||||
ver$ = Version$ 'eg. "0.123"
|
||||
x = INSTR(ver$, "."): IF x THEN ASC(ver$, x) = 95 'change "." to "_"
|
||||
libs$ = ""
|
||||
|
||||
IF DEPENDENCY(DEPENDENCY_GL) THEN
|
||||
|
|
Loading…
Reference in a new issue