mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Reorganize workflows and use multiple environments for different release stages
This commit is contained in:
parent
41298b53d4
commit
c221cfd493
4 changed files with 37 additions and 17 deletions
17
.github/workflows/branches-build.yml
vendored
Normal file
17
.github/workflows/branches-build.yml
vendored
Normal file
|
@ -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"
|
|
@ -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}}
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue