Skip to content

Commit

Permalink
Build full OS matrix, fix publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Jun 14, 2024
1 parent 0e8f9f1 commit b11da78
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 21 deletions.
62 changes: 45 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,53 @@ env:
DOTNET_NOLOGO: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
PackOnBuild: true
GeneratePackageOnBuild: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}

defaults:
run:
shell: bash

jobs:
build:
os-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.lookup.outputs.matrix }}
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
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:
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@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: 🙏 build
run: dotnet build -m:1
run: dotnet build -m:1 -bl:build.binlog

- name: ⚙ GNU grep
if: matrix.os == 'macOS-latest'
run: |
brew install grep
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
- name: ⚙ azurite
run: |
Expand All @@ -46,8 +75,12 @@ jobs:
- name: 🧪 test
uses: ./.github/workflows/test

- 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
Expand All @@ -62,17 +95,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: ✓ ensure format
run: |
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget
1 change: 1 addition & 0 deletions .github/workflows/os-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["ubuntu-latest", "windows-latest", "macOS-latest"]
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
- name: 🙏 build
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v} -bl:build.binlog

- name: ⚙ azurite
run: |
npm install azurite@3.20.1
npx azurite &
- name: 🧪 test
uses: ./.github/workflows/test

Expand All @@ -38,4 +43,4 @@ jobs:
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
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
4 changes: 1 addition & 3 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
weak
[file ".github/workflows/publish.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
sha = 5fb172362c767bef7c36478f1a6bdc264723f8f9
etag = 9ea4083894308a610742488923d2a44778ebba6ca73fb13424647d9a82c918b4
weak
skip
[file ".github/workflows/sponsor.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/sponsor.yml
sha = 5fb172362c767bef7c36478f1a6bdc264723f8f9
Expand Down

0 comments on commit b11da78

Please sign in to comment.