Migrate the Rider Plugin to use the v2 Meadow.CLI back-end #68
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: Rider plugin | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
main: | |
runs-on: ${{ matrix.image }} | |
strategy: | |
matrix: | |
image: [macos-13, ubuntu-22.04, windows-2022] | |
fail-fast: false | |
env: | |
DOTNET_NOLOGO: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
steps: | |
- name: Checkout current repo | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
- if: ${{ github.ref == 'refs/heads/main' }} | |
name: Checkout Meadow.CLI side-by-side | |
uses: actions/checkout@v4 | |
with: | |
repository: WildernessLabs/Meadow.CLI | |
path: Meadow.CLI | |
ref: main | |
- if: ${{ github.ref != 'refs/heads/main' }} | |
name: Checkout Meadow.CLI side-by-side | |
uses: actions/checkout@v4 | |
with: | |
repository: WildernessLabs/Meadow.CLI | |
path: Meadow.CLI | |
ref: dominique-TestDebugging | |
- name: Checkout Meadow.Contracts side-by-side | |
uses: actions/checkout@v4 | |
with: | |
repository: WildernessLabs/Meadow.Contracts | |
path: Meadow.Contracts | |
ref: main | |
- if: matrix.image == 'ubuntu-22.04' | |
name: Free disk space | |
uses: jlumbroso/[email protected] | |
with: | |
tool-cache: false | |
large-packages: false | |
# Common preparation | |
- name: Prepare build | |
run: ./gradlew prepare | |
working-directory: ./main | |
# Backend | |
- name: Set up .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Build Backend | |
run: dotnet build -c Release | |
working-directory: ./main | |
# Distribution | |
- name: Build Distribution | |
run: ./gradlew -PbuildConfiguration=Release -PbuildNumber=${{ github.run_number }} buildPlugin | |
working-directory: ./main | |
- name: Unpack distribution # for the purpose of uploading. Only on Linux to avoid zip name clash | |
if: matrix.image == 'ubuntu-22.04' | |
shell: pwsh | |
run: main/scripts/Unpack-Distribution.ps1 | |
- name: Read pluginVersion from gradle.properties | |
if: matrix.image == 'ubuntu-22.04' | |
id: read_version | |
run: | | |
pluginVersion=$(sed -n 's/^pluginVersion=\(.*\)/\1/p' main/gradle.properties) | |
echo "pluginVersion=$pluginVersion" | |
echo "plugin_version=$pluginVersion" >> $GITHUB_ENV | |
- name: Upload the artifact | |
if: matrix.image == 'ubuntu-22.04' # Only on Linux to avoid zip name clash | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rider-meadow-plugin-${{ env.plugin_version }} | |
path: main/build/distributions/unpacked | |
# Publish | |
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && matrix.image == 'ubuntu-22.04' }} | |
name: Publish | |
shell: pwsh | |
run: main/scripts/Publish-Distribution.ps1 -Channel dev -AuthToken $env:JETBRAINS_MARKETPLACE_TOKEN | |
env: | |
JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }} | |
validation: | |
runs-on: ubuntu-22.04 | |
name: "Validate Gradle wrapper" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/actions/wrapper-validation@v3 |