-
Notifications
You must be signed in to change notification settings - Fork 5
160 lines (130 loc) · 5.12 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: VS4Mac Extension
env:
IDE_TOOLS_RELEASE_VERSION: 1.9.2
MEADOW_OS_VERSION: 2.0.0.0
VS_MAC_2022_VERSION: 17.6
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-mac-2019:
runs-on: macos-11
steps:
- name: Checkout current repo
uses: actions/checkout@v3
with:
path: main
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v3
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: develop
- name: Set default Xamarin SDK versions
run: |
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --mac=8.2
- name: Setup .NET Core SDK 5.0.x and 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
5.0.x
6.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Rename VS so we pick up VS2019 IDE
run: |
mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app"
mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app"
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2019 Version Numbers
run: |
sed -i "" "s/Version = \"1.*\"/Version = \"${{ENV.IDE_TOOLS_RELEASE_VERSION}}\"/" main/VS4Mac_Meadow_Extension/Properties/AddinInfo.cs
- name: Restore our VS2019 project
run: |
msbuild main/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.csproj /t:Restore /p:Configuration=Release
- name: Build and Package the VS2019 Extension
run: |
msbuild main/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.csproj /t:Build /p:Configuration=Release /p:CreatePackage=true
- name: Upload mpack Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Mac.2019.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'main/VS4Mac_Meadow_Extension/bin/Release/net472/*.mpack'
build-mac-2022:
runs-on: macos-12
steps:
- name: Checkout current repo
uses: actions/checkout@v3
with:
path: main
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v3
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: develop
- name: Set default Xamarin SDK versions
run: |
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --mac=8.2
- name: Setup .NET Core 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
6.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2022 Version Numbers
run: |
sed -i "" "s/Version = \"1.*\"/Version = \"${{ ENV.IDE_TOOLS_RELEASE_VERSION }}\"/" main/VS4Mac_Meadow_Extension/Properties/AddinInfo.2022.cs
- name: Restore our VS2022 project
run: |
dotnet msbuild main/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.2022.csproj /t:Restore /p:Configuration=Release
- name: Build and Package the VS2022 Extension
run: |
dotnet msbuild main/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.2022.csproj /t:Build /p:Configuration=Release /p:CreatePackage=true
- name: Upload mpack Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Mac.2022.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'main/VS4Mac_Meadow_Extension/bin/Release/net7.0/*.mpack'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Get Commit Messages
id: commit_messages
uses: actions/github-script@v6
with:
github-token: ${{ secrets.MEADOW_MAC_TOKEN }}
script: |
const { owner, repo } = context.repo;
const latestRelease = await github.rest.repos.getLatestRelease({
owner: 'WildernessLabs',
repo: 'VS_Mac_Meadow_Extension',
});
const commits = await github.rest.repos.listCommits({
owner: 'WildernessLabs',
repo: 'VS_Mac_Meadow_Extension',
since: latestRelease.created_at
});
const messages = commits.data.map(commit => `* ${commit.commit.message}`).join(' \n');
const formattedMessages = `## What's Changed \n${messages}`;
return formattedMessages;
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Create VS2022 Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }}
with:
owner: WildernessLabs
repo: VS_Mac_Meadow_Extension
tag_name: v${{ ENV.IDE_TOOLS_RELEASE_VERSION }}-vsm${{ ENV.VS_MAC_2022_VERSION }}
release_name: VS Mac VS2022 Extension v${{ ENV.IDE_TOOLS_RELEASE_VERSION }} for Meadow OS v${{ ENV.MEADOW_OS_VERSION }}
body: |
${{ steps.commit_messages.outputs.result }}
draft: true
prerelease: false
commitish: main