From 7b9a487f526950919c586aa0d660fc7fd01425d0 Mon Sep 17 00:00:00 2001 From: Riri Date: Thu, 14 Mar 2024 19:42:25 +0800 Subject: [PATCH] ci: add build workflow for WebSearchShortcut plugin --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c62f526 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + branches: + - main + +env: + PLUGIN_NAME: WebSearchShortcut + +jobs: + build: + strategy: + matrix: + platform: [x64, ARM64] + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Read version + run: | + [xml]$xml = Get-Content -Path Directory.Build.Props + echo "PLUGIN_VERSION=$($xml.Project.PropertyGroup.Version)" >> $env:GITHUB_ENV + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Build + run: dotnet build PowerToys-Run-WebSearchShortcut.sln --configuration Release /p:Platform=${{matrix.platform}} /p:EnableWindowsTargeting=true + + - name: Prepare artifact + run: | + Remove-Item -Path Community.PowerToys.Run.Plugin.WebSearchShortcut\bin\* -Recurse -Include *.xml, *.pdb, PowerToys.*, Wox.* + Rename-Item -Path Community.PowerToys.Run.Plugin.WebSearchShortcut\bin\${{matrix.platform}}\Release -NewName $env:PLUGIN_NAME + Compress-Archive -Path Community.PowerToys.Run.Plugin.WebSearchShortcut\bin\${{matrix.platform}}\$env:PLUGIN_NAME -DestinationPath "${{env.PLUGIN_NAME}}-${{env.PLUGIN_VERSION}}-${{matrix.platform}}.zip"