diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e550e5c1..648d55a4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,48 +4,81 @@ name: build on: workflow_dispatch: + inputs: + configuration: + type: choice + description: Configuration + options: + - Release + - Debug push: branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ] paths-ignore: - changelog.md - - code-of-conduct.md - - security.md - - support.md - readme.md pull_request: types: [opened, synchronize, reopened] env: DOTNET_NOLOGO: true + PackOnBuild: true + GeneratePackageOnBuild: true VersionPrefix: 42.42.${{ github.run_number }} VersionLabel: ${{ github.ref }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + MSBUILDTERMINALLOGGER: auto + Configuration: ${{ github.event.inputs.configuration || 'Release' }} defaults: run: shell: bash jobs: + os-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.lookup.outputs.matrix }} + steps: + - name: ๐Ÿค˜ checkout + uses: actions/checkout@v4 + + - name: ๐Ÿ”Ž lookup + id: lookup + shell: pwsh + run: | + $path = './.github/workflows/os-matrix.json' + $os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' } + echo "matrix=$os" >> $env:GITHUB_OUTPUT + build: - runs-on: windows-latest + needs: os-matrix + name: build-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ${{ fromJSON(needs.os-matrix.outputs.matrix) }} steps: - name: ๐Ÿค˜ checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: ๐Ÿ™ build - run: dotnet build -m:1 + run: dotnet build -m:1 -bl:build.binlog - name: ๐Ÿงช test run: | dotnet tool update -g dotnet-retest dotnet retest -- --no-build - - name: ๐Ÿ“ฆ pack - run: dotnet pack -m:1 + - name: ๐Ÿ› logs + uses: actions/upload-artifact@v3 + if: runner.debug && always() + with: + name: logs + path: '*.binlog' - # Only push CI package to sleet feed if building on ubuntu (fastest) - name: ๐Ÿš€ sleet env: SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} @@ -55,10 +88,10 @@ jobs: sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" dotnet-format: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - name: ๐Ÿค˜ checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0ab108db4..a4be3ad59 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,34 +5,52 @@ name: publish on: release: - types: [released] + types: [prereleased, released] env: DOTNET_NOLOGO: true Configuration: Release - -defaults: - run: - shell: bash - + PackOnBuild: true + GeneratePackageOnBuild: true + VersionLabel: ${{ github.ref }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + MSBUILDTERMINALLOGGER: auto + jobs: publish: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - name: ๐Ÿค˜ checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: ๐Ÿ™ build - run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v} + run: dotnet build -m:1 -bl:build.binlog - name: ๐Ÿงช test - uses: ./.github/workflows/test + run: | + dotnet tool update -g dotnet-retest + dotnet retest -- --no-build - - name: ๐Ÿ“ฆ pack - run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v} + - name: ๐Ÿ› logs + uses: actions/upload-artifact@v3 + if: runner.debug && always() + with: + name: logs + path: '*.binlog' - name: ๐Ÿš€ nuget - run: dotnet nuget push bin/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + if: env.NUGET_API_KEY != '' + run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate + + - name: ๐Ÿš€ sleet + env: + SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} + if: env.SLEET_CONNECTION != '' + run: | + dotnet tool install -g --version 4.0.18 sleet + sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" \ No newline at end of file diff --git a/.netconfig b/.netconfig index 4a4aa0491..79114c2fd 100644 --- a/.netconfig +++ b/.netconfig @@ -43,7 +43,9 @@ weak [file ".github/workflows/build.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml - skip + sha = 7ec91019eddb4fc7e0b09118538b256087f82e18 + etag = 35b2a5b03c26cbe7522e30b2b987e04991e8ba18accd38b7ebd88191f1698c2d + weak [file ".github/workflows/changelog.config"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config sha = 08d83cb510732f861416760d37702f9f55bd7f9e @@ -61,7 +63,9 @@ weak [file ".github/workflows/publish.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml - skip + sha = b5bb972199aa6ff220dda196588b23c21bb2780f + etag = 5a85d51e8c6cc6fbda43e12b3712a1e908a8e99b0908c4033ac9f4c66e5f233e + weak [file ".gitignore"] url = https://github.com/devlooped/oss/blob/main/.gitignore sha = 02811fa23b0a102b9b33048335d41e515bf75737