From ec388a5792d200158fb7be7c8aad38288932fe09 Mon Sep 17 00:00:00 2001 From: Samir Sinha Date: Fri, 4 Nov 2022 08:50:40 -0700 Subject: [PATCH] 0.4 prep (#18) * Created a version header * Testing release workflow --- .github/workflows/build-linux.yml | 2 -- .github/workflows/build-windows.yml | 24 ++++++++++++++---------- host/clem_front.cpp | 4 +++- host/version.h | 7 +++++++ 4 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 host/version.h diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 45901e01..f71c96d2 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -3,8 +3,6 @@ name: CMake on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 4b42ff75..e0c307e4 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -2,9 +2,10 @@ name: CMake on: push: - branches: [ "main" ] + branches: [ 'main' ] + tags: ['v*'] pull_request: - branches: [ "main" ] + branches: [ 'main' ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -30,19 +31,22 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DBUILD_TESTING=OFF + run: | + echo ${{ github.event_name }} + echo ${{ github.ref_name }} + echo ${{ github.ref_type }} + cmake -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DBUILD_TESTING=OFF - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - # - name: Archive production artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: dist - # path: ${{github.workspace}}/build-run/clemens_iigs/Release/* - # retention-days: 1 - + - name: Archive production artifacts + if: ${{ github.ref_type == 'tag'}} + uses: actions/upload-artifact@v3 + with: + name: clemens-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.zip + path: ${{github.workspace}}/build-run/clemens_iigs/Release/* # - name: Test # working-directory: ${{github.workspace}}/build diff --git a/host/clem_front.cpp b/host/clem_front.cpp index 78927867..c7df2f19 100644 --- a/host/clem_front.cpp +++ b/host/clem_front.cpp @@ -1,3 +1,4 @@ +#include "version.h" #include "clem_front.hpp" #include "clem_backend.hpp" #include "clem_disk_utils.hpp" @@ -343,7 +344,8 @@ ClemensFrontend::ClemensFrontend(const cinek::ByteBuffer &systemFontLoBuffer, debugMemoryEditor_.ReadFn = &ClemensFrontend::imguiMemoryEditorRead; debugMemoryEditor_.WriteFn = &ClemensFrontend::imguiMemoryEditorWrite; - CLEM_TERM_COUT.print(TerminalLine::Info, "Welcome to the Clemens IIgs Emulator"); + CLEM_TERM_COUT.format(TerminalLine::Info, "Welcome to the Clemens IIgs Emulator {}.{}", + CLEM_HOST_VERSION_MAJOR, CLEM_HOST_VERSION_MINOR); } ClemensFrontend::~ClemensFrontend() { diff --git a/host/version.h b/host/version.h new file mode 100644 index 00000000..9d809861 --- /dev/null +++ b/host/version.h @@ -0,0 +1,7 @@ +#ifndef CLEM_HOST_VERSION_H +#define CLEM_HOST_VERSION_H + +#define CLEM_HOST_VERSION_MAJOR 0 +#define CLEM_HOST_VERSION_MINOR 4 + +#endif