Change to support v2. #306
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |