Skip to content

Commit b11da78

Browse files
committed
Build full OS matrix, fix publish workflow
1 parent 0e8f9f1 commit b11da78

File tree

4 files changed

+53
-21
lines changed

4 files changed

+53
-21
lines changed

.github/workflows/build.yml

+45-17
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,53 @@ env:
1919
DOTNET_NOLOGO: true
2020
VersionPrefix: 42.42.${{ github.run_number }}
2121
VersionLabel: ${{ github.ref }}
22+
PackOnBuild: true
23+
GeneratePackageOnBuild: true
24+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
25+
26+
defaults:
27+
run:
28+
shell: bash
2229

2330
jobs:
24-
build:
31+
os-matrix:
2532
runs-on: ubuntu-latest
33+
outputs:
34+
matrix: ${{ steps.lookup.outputs.matrix }}
2635
steps:
2736
- name: 🤘 checkout
28-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
38+
39+
- name: 🔎 lookup
40+
id: lookup
41+
shell: pwsh
42+
run: |
43+
$path = './.github/workflows/os-matrix.json'
44+
$os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' }
45+
echo "matrix=$os" >> $env:GITHUB_OUTPUT
46+
47+
build:
48+
needs: os-matrix
49+
name: build-${{ matrix.os }}
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
matrix:
53+
os: ${{ fromJSON(needs.os-matrix.outputs.matrix) }}
54+
steps:
55+
- name: 🤘 checkout
56+
uses: actions/checkout@v4
2957
with:
3058
submodules: recursive
3159
fetch-depth: 0
3260

33-
- uses: actions/setup-dotnet@v3
34-
with:
35-
dotnet-version: '8.0.x'
36-
dotnet-quality: 'preview'
37-
3861
- name: 🙏 build
39-
run: dotnet build -m:1
62+
run: dotnet build -m:1 -bl:build.binlog
63+
64+
- name: ⚙ GNU grep
65+
if: matrix.os == 'macOS-latest'
66+
run: |
67+
brew install grep
68+
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
4069
4170
- name: ⚙ azurite
4271
run: |
@@ -46,8 +75,12 @@ jobs:
4675
- name: 🧪 test
4776
uses: ./.github/workflows/test
4877

49-
- name: 📦 pack
50-
run: dotnet pack -m:1
78+
- name: 🐛 logs
79+
uses: actions/upload-artifact@v3
80+
if: runner.debug && always()
81+
with:
82+
name: logs
83+
path: '*.binlog'
5184

5285
# Only push CI package to sleet feed if building on ubuntu (fastest)
5386
- name: 🚀 sleet
@@ -62,17 +95,12 @@ jobs:
6295
runs-on: ubuntu-latest
6396
steps:
6497
- name: 🤘 checkout
65-
uses: actions/checkout@v2
98+
uses: actions/checkout@v4
6699
with:
67100
submodules: recursive
68101
fetch-depth: 0
69102

70-
- uses: actions/setup-dotnet@v3
71-
with:
72-
dotnet-version: '8.0.x'
73-
dotnet-quality: 'preview'
74-
75103
- name: ✓ ensure format
76104
run: |
77105
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget
78-
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget
106+
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget

.github/workflows/os-matrix.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["ubuntu-latest", "windows-latest", "macOS-latest"]

.github/workflows/publish.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
- name: 🙏 build
2828
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v} -bl:build.binlog
2929

30+
- name: ⚙ azurite
31+
run: |
32+
npm install [email protected]
33+
npx azurite &
34+
3035
- name: 🧪 test
3136
uses: ./.github/workflows/test
3237

@@ -38,4 +43,4 @@ jobs:
3843
path: '*.binlog'
3944

4045
- name: 🚀 nuget
41-
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
46+
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate

.netconfig

+1-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
weak
6969
[file ".github/workflows/publish.yml"]
7070
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
71-
sha = 5fb172362c767bef7c36478f1a6bdc264723f8f9
72-
etag = 9ea4083894308a610742488923d2a44778ebba6ca73fb13424647d9a82c918b4
73-
weak
71+
skip
7472
[file ".github/workflows/sponsor.yml"]
7573
url = https://github.com/devlooped/oss/blob/main/.github/workflows/sponsor.yml
7674
sha = 5fb172362c767bef7c36478f1a6bdc264723f8f9

0 commit comments

Comments
 (0)