Skip to content

Commit eeb0324

Browse files
committed
Update and future-proof build scripts
First and most important: add unicode icons! Second: instead of hardcoding `preview` as the VS being searched, leverage the ability to select the first instance greater than or equal to 16.8 we find on the machine. This means we won't be force-installing a preview VS when 16.8 becomes the built-in version in hosted agents. Also, it means when 16.9 or future versions become stable too, we won't need to modify scripts again, since we'll automatically use a later version this way.
1 parent 1877f57 commit eeb0324

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: build
22
on: push
33

44
env:
@@ -9,30 +9,38 @@ jobs:
99
build:
1010
runs-on: windows-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: set version
12+
- name: 🤘 checkout
13+
uses: actions/checkout@v2
14+
- name: 🖉 version
1415
run: echo "VERSION_SUFFIX=$(git name-rev --name-only --refs=refs/heads/* HEAD).$($env:GITHUB_RUN_NUMBER)" >> $GITHUB_ENV
15-
- uses: actions/setup-dotnet@v1
16+
- name: ⚙ dotnet 5.0.x
17+
uses: actions/setup-dotnet@v1
1618
with:
17-
dotnet-version: 5.0.100-rc.1.20452.10
18-
- uses: actions/setup-dotnet@v1
19+
dotnet-version: 5.0.x
20+
- name: ⚙ dotnet 2.1.x
21+
uses: actions/setup-dotnet@v1
1922
with:
2023
dotnet-version: 2.1.x
21-
- uses: actions/setup-dotnet@v1
24+
- name: ⚙ dotnet 3.1.x
25+
uses: actions/setup-dotnet@v1
2226
with:
2327
dotnet-version: 3.1.x
24-
- run: dotnet tool update -g dotnet-vs
25-
- run: echo "MSB=$(vs where preview --prop=InstallationPath)" >> $GITHUB_ENV
26-
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
28+
- name: 🔽 dotnet-vs
29+
run: dotnet tool update -g dotnet-vs
30+
- name: 🔍 vs 16.8+
31+
run: echo "MSB=$(vs where --prop=InstallationPath --first -version 16.8)" >> $GITHUB_ENV
32+
- name: 🔽 vs community
33+
run: vs install community --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
2734
if: env.MSB == ''
28-
- run: echo "$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" >> $GITHUB_PATH
29-
- name: build
35+
- name: ≥ msbuild
36+
run: echo "$(vs where --prop=InstallationPath --first -version 16.8)\MSBuild\Current\Bin" >> $GITHUB_PATH
37+
- name: 🙏 build
3038
run: msbuild -r -p:versionsuffix=$($env:VERSION_SUFFIX)
31-
- name: test
39+
- name: 🧪 test
3240
run: msbuild -t:test
33-
- name: pack
41+
- name: 📦 pack
3442
run: msbuild -t:pack -p:nobuild=true -p:versionsuffix=$($env:VERSION_SUFFIX)
35-
- name: sleet
43+
- name: 🚀 sleet
3644
run: |
3745
dotnet tool install -g --version 3.2.0 sleet
3846
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure"

.github/workflows/release.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: release
22
on:
33
release:
44
types: [created]
@@ -12,29 +12,37 @@ jobs:
1212
build:
1313
runs-on: windows-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: set version
15+
- name: 🤘 checkout
16+
uses: actions/checkout@v2
17+
- name: 🖉 version
1718
run: echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
1819
shell: bash
19-
- uses: actions/setup-dotnet@v1
20+
- name: ⚙ dotnet 5.0.x
21+
uses: actions/setup-dotnet@v1
2022
with:
21-
dotnet-version: 5.0.100-rc.1.20452.10
22-
- uses: actions/setup-dotnet@v1
23+
dotnet-version: 5.0.x
24+
- name: ⚙ dotnet 2.1.x
25+
uses: actions/setup-dotnet@v1
2326
with:
2427
dotnet-version: 2.1.x
25-
- uses: actions/setup-dotnet@v1
28+
- name: ⚙ dotnet 3.1.x
29+
uses: actions/setup-dotnet@v1
2630
with:
2731
dotnet-version: 3.1.x
28-
- run: dotnet tool update -g dotnet-vs
29-
- run: echo "MSB=$(vs where preview --prop=InstallationPath)" >> $GITHUB_ENV
30-
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
32+
- name: 🔽 dotnet-vs
33+
run: dotnet tool update -g dotnet-vs
34+
- name: 🔍 vs 16.8+
35+
run: echo "MSB=$(vs where --prop=InstallationPath --first -version 16.8)" >> $GITHUB_ENV
36+
- name: 🔽 vs community
37+
run: vs install community --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
3138
if: env.MSB == ''
32-
- run: echo "$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" >> $GITHUB_PATH
33-
- name: build
39+
- name: ≥ msbuild
40+
run: echo "$(vs where --prop=InstallationPath --first -version 16.8)\MSBuild\Current\Bin" >> $GITHUB_PATH
41+
- name: 🙏 build
3442
run: msbuild -r -p:version=$($env:VERSION)
35-
- name: test
43+
- name: 🧪 test
3644
run: msbuild -t:test
37-
- name: pack
45+
- name: 📦 pack
3846
run: msbuild -t:pack -p:nobuild=true -p:version=$($env:VERSION)
39-
- name: push
47+
- name: 🚀 push
4048
run: dotnet nuget push bin\**\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate

0 commit comments

Comments
 (0)