Skip to content

Commit

Permalink
Add project automatic version (#29)
Browse files Browse the repository at this point in the history
- Add automatic version, commits now has to have this tag on the end:

"+semver: major | minor | patch"

or

"+semver: break | feature | fix"

to track  what has changed so it can calculate the current version

- Add docker build / push of the server image

Signed-off-by: Renato Foot <[email protected]>
  • Loading branch information
Costallat authored Jun 11, 2021
1 parent 2d8d288 commit 4f2fd29
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Build - Docker

on:
pull_request:
push:
branches:
- master
- dev
- devel
- develop

env:
VCPKG_BUILD_TYPE: release
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: '-j 2'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
file: docker/server/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.gitversion.outputs.semVer }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
1 change: 1 addition & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ jobs:
!${{ github.workspace }}/cmake/
!${{ github.workspace }}/sonar-project.properties
!${{ github.workspace }}/Jenkinsfile
!${{ github.workspace }}/GitVersion.yml
5 changes: 3 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Create and Upload Full Datapack
uses: actions/upload-artifact@v2
with:
name: canary-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
name: canary-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ steps.gitversion.outputs.semVer }}
path: |
${{ github.workspace }}
!${{ github.workspace }}/build/
Expand All @@ -84,10 +84,11 @@ jobs:
!${{ github.workspace }}/cmake/
!${{ github.workspace }}/sonar-project.properties
!${{ github.workspace }}/Jenkinsfile
!${{ github.workspace }}/GitVersion.yml
- name: Create and Upload Server Only
uses: actions/upload-artifact@v2
with:
name: canary-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
name: canary-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ steps.gitversion.outputs.semVer }}
path: |
${{ github.workspace }}/build/bin/
7 changes: 7 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
assembly-versioning-scheme: MajorMinorPatchTag
mode: ContinuousDelivery
branches: {}
ignore:
sha: []
merge-message-formats: {}
4 changes: 3 additions & 1 deletion src/lua/scripts/lua_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
LuaEnvironment::LuaEnvironment(): LuaScriptInterface("Main Interface") {}

LuaEnvironment::~LuaEnvironment() {
delete testInterface;
if (!testInterface) {
delete testInterface;
}
closeState();
}

Expand Down

0 comments on commit 4f2fd29

Please sign in to comment.