diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5ffb3c9c..61000db9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,10 +3,20 @@ name: linux on: pull_request: push: - release: - types: published jobs: + create_dev_release: + runs-on: ubuntu-18.04 + steps: + - name: Create Development release + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }} + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Development Build" + vanilla-linux: runs-on: ubuntu-18.04 strategy: @@ -80,3 +90,24 @@ jobs: with: name: vanilla-conquer-linux-${{ matrix.platform }}-x86_64 path: artifact + + - name: Upload development release + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }} + uses: softprops/action-gh-release@v1 + with: + name: Development Build + tag_name: "latest" + prerelease: true + files: | + artifact/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload tagged release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: softprops/action-gh-release@v1 + with: + files: | + artifact/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 472a58e6..07bff34c 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -3,8 +3,6 @@ name: mingw-w64 on: pull_request: push: - release: - types: published jobs: remaster_gcc: @@ -107,11 +105,32 @@ jobs: - name: Create archives run: | mkdir artifact - 7z a artifact/vanilla-conquer-standalone-win-i386-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd.exe ./build/vanillara.exe /tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll - 7z a artifact/vanilla-conquer-standalone-win-i386-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.dbg ./build/vanillara.dbg + 7z a artifact/vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd.exe ./build/vanillara.exe /tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll + 7z a artifact/vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.dbg ./build/vanillara.dbg - name: Upload artifact uses: actions/upload-artifact@v2 with: name: vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }} path: artifact + + - name: Upload development release + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }} + uses: softprops/action-gh-release@v1 + with: + name: Development Build + tag_name: "latest" + prerelease: true + files: | + artifact/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload tagged release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: softprops/action-gh-release@v1 + with: + files: | + artifact/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7a367cec..c91c164c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,8 +3,6 @@ name: windows on: pull_request: push: - release: - types: published jobs: remaster_msvc: @@ -52,6 +50,27 @@ jobs: name: vanilla-conquer-remaster-msvc path: artifact + - name: Upload development release + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }} + uses: softprops/action-gh-release@v1 + with: + name: Development Build + tag_name: "latest" + prerelease: true + files: | + artifact\* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload tagged release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: softprops/action-gh-release@v1 + with: + files: | + artifact\* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + vanilla_win_msvc: runs-on: windows-2019 strategy: @@ -120,3 +139,24 @@ jobs: with: name: vanilla-conquer-win-msvc-${{ steps.vars.outputs.arc_path }} path: artifact + + - name: Upload development release + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }} + uses: softprops/action-gh-release@v1 + with: + name: Development Build + tag_name: "latest" + prerelease: true + files: | + artifact\* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload tagged release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: softprops/action-gh-release@v1 + with: + files: | + artifact\* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 3ca42ea4..df83ed54 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,10 @@ make -j8 This will build Vanilla Conquer executables in the build directory. +## Releases + +Binary releases of the latest commit are available from [here](https://github.com/TheAssemblyArmada/Vanilla-Conquer/releases/tag/latest), which is updated whenever new code is merged into the main branch. + ## Running ### VanillaTD and VanillaRA diff --git a/redalert/version.cpp b/redalert/version.cpp index 40755bb6..2f20d1b5 100644 --- a/redalert/version.cpp +++ b/redalert/version.cpp @@ -408,7 +408,8 @@ unsigned short VersionClass::Minor_Version(void) *=========================================================================*/ char* VersionClass::Version_Name(void) { - if (*GitTag == '\0') { + // Only print the git tag version number if it starts with 'v' + if (*GitTag == '\0' || GitUncommittedChanges || *GitTag != 'v') { snprintf(VersionName, sizeof(VersionName), "r%d %s%s", diff --git a/tiberiandawn/init.cpp b/tiberiandawn/init.cpp index 939a26c5..d4042291 100644 --- a/tiberiandawn/init.cpp +++ b/tiberiandawn/init.cpp @@ -2355,7 +2355,8 @@ void Parse_INI_File(void) *=============================================================================================*/ int Version_Number(void) { - if (*GitTag == '\0' || GitUncommittedChanges) { + // Only print the git tag version number if it starts with 'v' + if (*GitTag == '\0' || GitUncommittedChanges || *GitTag != 'v') { snprintf(VersionText, sizeof(VersionText), "r%d %s%s",