Build DO on dispatch (run by alex-kulakov) Run No 1 in Release config. #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🏗 Build on dispatch | |
| run-name: Build DO on dispatch (run by ${{ github.actor }}) Run No ${{ github.run_number }} in ${{ inputs.buildConfiguration }} config. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| buildConfiguration: | |
| description: 'Build configuration' | |
| required: true | |
| default: 'Release' | |
| type: choice | |
| options: | |
| - Debug | |
| - Release | |
| verbosity: | |
| description: 'dotnet build verbosity' | |
| required: false | |
| default: 'minimal' | |
| type: choice | |
| options: | |
| - quiet | |
| - minimal | |
| - normal | |
| - detailed | |
| - diagnostic | |
| specific_sha: | |
| description: 'Commit SHA to checkout(optional)' | |
| required: false | |
| default: '' | |
| type: string | |
| publish_artifacts: | |
| description: 'Publish artifacts' | |
| required: true | |
| default: false | |
| type: boolean | |
| # new commits with the same key will cancel previously run workflows | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| env: | |
| BUILD_CONFIG: ${{ inputs.buildConfiguration }} | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| steps: | |
| - name: Downgrade OpenSSL | |
| timeout-minutes: 3 | |
| run: | | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb | |
| sudo dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb | |
| - name: Checkout repo (last commit) | |
| if: ${{ inputs.specific_sha == '' || github.reg_type != 'branch' }} | |
| timeout-minutes: 1 | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Checkout repo (last 50 commit) | |
| if: ${{ inputs.specific_sha != '' && github.reg_type == 'branch' }} | |
| timeout-minutes: 1 | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| fetch-depth: 50 | |
| # it leads to detached HEAD, but we don't commit anything anyway | |
| - name: Manual commit checkout if required | |
| if: ${{ inputs.specific_sha != '' && github.reg_type == 'branch' }} | |
| run: git checkout ${{ inputs.specific_sha }} | |
| - name: Setup .NETs | |
| if: ${{ success() }} | |
| timeout-minutes: 2 | |
| uses: ./.github/actions/setup-dotnets | |
| with: | |
| target_framework: netcoreapp2.0 | |
| - name: Build Orm | |
| if: ${{ success() }} | |
| run: dotnet build Orm.sln --configuration $BUILD_CONFIG -v ${{ inputs.verbosity }} | |
| - name: Organize files | |
| if: ${{ success() && inputs.buildConfiguration == 'Release' && inputs.publish_artifacts }} | |
| run: | | |
| mkdir -p _Build/bin/Release/Binaries | |
| mkdir -p _Build/bin/Release/Dist | |
| cp -r _Build/bin/Release/lib _Build/bin/Release/Binaries/ | |
| cp -r _Build/bin/Release/tools _Build/bin/Release/Binaries/ | |
| cp -r _Build/bin/Release/packages _Build/bin/Release/Dist/ | |
| - name: Publish artifacts | |
| if: ${{ success() && inputs.buildConfiguration == 'Release' && inputs.publish_artifacts }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DO_${{ github.ref_name }}_${{ github.run_number }} | |
| path: | | |
| _Build/bin/Release/Binaries/** | |
| _Build/bin/Release/Dist/** | |
| if-no-files-found: error | |
| retention-days: 1 |