diff --git a/.github/workflows/branches-build.yml b/.github/workflows/branches-build.yml new file mode 100644 index 00000000..c3fa846a --- /dev/null +++ b/.github/workflows/branches-build.yml @@ -0,0 +1,17 @@ +name: Build branch + +on: + push: + branches: + - '**' + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-all: + uses: ./.github/workflows/shared-build.yml + with: + environment: "testing" diff --git a/.github/workflows/codeql.yml b/.github/workflows/main-codeql.yml similarity index 100% rename from .github/workflows/codeql.yml rename to .github/workflows/main-codeql.yml diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/shared-build.yml similarity index 94% rename from .github/workflows/build-cmake.yml rename to .github/workflows/shared-build.yml index ae71b900..13561ffd 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/shared-build.yml @@ -1,19 +1,16 @@ -name: Build +name: Shared build workflow on: - push: - branches: - - '**' - pull_request: workflow_call: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + inputs: + environment: + required: true + type: string env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: RelWithDebInfo + RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }} jobs: build-platform-linux: @@ -30,7 +27,8 @@ jobs: ] name: "Building for platform linux-${{matrix.architecture.name}}" - runs-on: ubuntu-22.04 + runs-on: "ubuntu-22.04" + environment: ${{ inputs.environment }} steps: - name: Settings @@ -95,7 +93,8 @@ jobs: -DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \ -DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \ -DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \ - -DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV + -DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \ + -DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV - name: Configure CMake working-directory: ${{github.workspace}} @@ -141,7 +140,8 @@ jobs: ] name: "Building for platform windows-${{matrix.architecture.name}}" - runs-on: windows-2022 + runs-on: "windows-2022" + environment: ${{ inputs.environment }} steps: - name: Settings @@ -212,7 +212,8 @@ jobs: -DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' ` -DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' ` -DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' ` - -DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV + -DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' ` + -DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV - name: Configure CMake working-directory: ${{github.workspace}} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/tags-publish-release.yml similarity index 85% rename from .github/workflows/publish-release.yml rename to .github/workflows/tags-publish-release.yml index af685159..54b22beb 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/tags-publish-release.yml @@ -6,7 +6,7 @@ on: - "v*.*.*" env: - RELEASE_TYPE: ${{ vars.RELEASE_TYPE || 'test' }} + RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }} RELEASE_IS_PRERELEASE: ${{ vars.RELEASE_IS_PRELEASE }} permissions: @@ -14,7 +14,9 @@ permissions: jobs: build-all: - uses: ./.github/workflows/build-cmake.yml + uses: ./.github/workflows/shared-build.yml + with: + environment: "release" deploy_all: strategy: @@ -39,7 +41,7 @@ jobs: ] runs-on: ubuntu-22.04 - environment: release + environment: "release" needs: [build-all] env: @@ -58,6 +60,6 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 with: - name: '${{github.ref_name}}-${{env.RELEASE_TYPE}}' + name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}' prerelease: ${{env.RELEASE_IS_PRERELEASE}} files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip