diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..0f8b9ff8a --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,35 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Clone. + uses: actions/checkout@v1 + - name: Set up JDK 1.8. + run: | + choco install jdk8 -params 'installdir=c:\\java8' + - name: Set up version of Chatty. + run: | + git checkout master + git remote add upstream https://github.com/chatty/chatty + git fetch --all + git branch master --set-upstream-to upstream/master + git status + git status > ch.txt + python version.py + - name: Build with Gradle. + run: | + gradlew build && gradlew release + - name: Build with installers. + run: | + ./win_standalone.bat + - uses: actions/upload-artifact@master + name: Upload artifacts. + with: + name: Chatty + path: build\releases\ \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5f3930f64..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,16 +0,0 @@ -environment: - JAVA_HOME: C:\Program Files\Java\jdk1.8.0 - -build_script: - - gradlew build - - gradlew release - -artifacts: - - path: '\build\releases\*.zip' - - path: '\build\releases\*.exe' - -after_build: - - win_standalone.bat - -cache: - - C:\Users\appveyor\.gradle \ No newline at end of file diff --git a/version.py b/version.py new file mode 100644 index 000000000..b47a7130f --- /dev/null +++ b/version.py @@ -0,0 +1,24 @@ +import re + +file = open('ch.txt','r'); +str = file.readlines()[1]; +sub = str[45:48]; +print(sub); + +path = "src/chatty/Chatty.java"; +chatty = open(path, 'r'); +line = chatty.read(); +chatty.close(); + +if not line: + exit(1); + +chatty = open(path, 'w'); +line = re.sub( + r"public static final String VERSION = \"0.10.0.[0-9]+", + "public static final String VERSION = \"0.10.0.%s" % sub, + line +); +#print(line) +chatty.write(line); +chatty.close(); \ No newline at end of file diff --git a/win_standalone.bat b/win_standalone.bat index ebb1df484..e52e17585 100644 --- a/win_standalone.bat +++ b/win_standalone.bat @@ -1 +1,3 @@ -gradlew windowsZip -PjavapackagerPath="c:\Program Files\Java\jdk1.8.0\bin\javapackager.exe" && gradlew innosetup -PinnosetupPath="c:\Program Files (x86)\Inno Setup 5\ISCC.exe" && gradlew innosetupStandalone -PinnosetupPath="c:\Program Files (x86)\Inno Setup 5\ISCC.exe" -PjavapackagerPath="c:\Program Files\Java\jdk1.8.0\bin\javapackager.exe" \ No newline at end of file +( gradlew windowsZip -PjavapackagerPath="c:\java8\bin\javapackager.exe" +gradlew innosetup -PinnosetupPath="c:\Program Files (x86)\Inno Setup 6\ISCC.exe" +gradlew innosetupStandalone -PinnosetupPath="c:\Program Files (x86)\Inno Setup 6\ISCC.exe" -PjavapackagerPath="c:\java8\bin\javapackager.exe") \ No newline at end of file