Update CI and release actions to include some fixes from main MonoMod CI #78
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| defaults: | |
| run: | |
| shell: pwsh | |
| env: | |
| DOTNET_TELEMETRY_OPTOUT: ttrue | |
| DOTNET_NOLOGO: true | |
| NUGET_PACKAGES: ${{github.workspace}}/artifacts/pkg | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| name: Setup | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip == 'true' || steps.msg_check.outputs.skip == 'true' }} | |
| upload_pkgs: ${{ steps.msg_check.outputs.skip != 'true' }} | |
| skipped_by: ${{ steps.skip_check.outputs.skipped_by }} | |
| ver: ${{ steps.computever.outputs.ver }} | |
| checkid: ${{ steps.result_check.outpus.check_id }} | |
| steps: | |
| - name: Check if this run should be skipped | |
| id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v5 | |
| with: | |
| cancel_others: true | |
| concurrent_skipping: same_content_newer | |
| - name: Check if this run is skipped by commit message | |
| id: msg_check | |
| run: echo "skip=${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[skip-ci]') }}" >> $env:GITHUB_OUTPUT | |
| - name: Compute Version | |
| id: computever | |
| run: echo "ver=$(Get-Date -Format y.M.d).${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_OUTPUT | |
| build: | |
| needs: [setup] | |
| if: needs.setup.outputs.should_skip != 'true' | |
| name: "Build #${{ needs.setup.outputs.ver }}" | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| version: daily.${{ needs.setup.outputs.ver }} | |
| upload: | |
| needs: [setup, build] | |
| if: ${{ needs.setup.outputs.upload_pkgs == 'true' && github.ref_name == 'master' && (success() || needs.setup.result == 'success') }} | |
| name: Upload Packages | |
| uses: ./.github/workflows/upload-packages.yml | |
| with: | |
| run-id: ${{ needs.setup.outputs.should_skip == 'true' && fromJSON(needs.setup.outputs.skipped_by).id || github.run_id }} |