-
Notifications
You must be signed in to change notification settings - Fork 5
110 lines (92 loc) · 3.53 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
name: VS4Mac Extension
env:
IDE_TOOLS_RELEASE_VERSION: 2.0.0
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-2022:
runs-on: macos-12
steps:
- name: Checkout current repo
uses: actions/checkout@v4
with:
path: main
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v4
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: dominique-MigrateVS2022ExtensionTov2
- name: Checkout Meadow.Contracts side-by-side
uses: actions/checkout@v4
with:
repository: WildernessLabs/Meadow.Contracts
path: Meadow.Contracts
ref: main
- name: Setup .NET Core 6.0.x, 7.0.x and 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- 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@v4
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