Skip to content

Commit

Permalink
Implements automated releases from the CI.
Browse files Browse the repository at this point in the history
Every push to vanilla updates a "latest" release dev build.
Tags pushed to vanilla create a versioned release build.
  • Loading branch information
OmniBlade committed Apr 1, 2021
1 parent 67e4772 commit e6cd02d
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 10 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
27 changes: 23 additions & 4 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: mingw-w64
on:
pull_request:
push:
release:
types: published

jobs:
remaster_gcc:
Expand Down Expand Up @@ -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 }}
44 changes: 42 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: windows
on:
pull_request:
push:
release:
types: published

jobs:
remaster_msvc:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion redalert/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion tiberiandawn/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e6cd02d

Please sign in to comment.