Skip to content

package

package #14

Workflow file for this run

name: package
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
outputs:
PowerToys_Version: ${{steps.version.outputs.PowerToys_Version}}
strategy:
matrix:
platform: [x64, ARM64]
steps:
- name: Checkout PowerToys
uses: actions/checkout@v4
with:
repository: microsoft/PowerToys
fetch-depth: 0
- name: Set version
run: echo ("PowerToys_Version=" + (git describe --abbrev=0 --tags).substring(1)) >> $env:GITHUB_ENV
- name: Output version
id: version
run: echo "PowerToys_Version=${{env.PowerToys_Version}}" >> "$env:GITHUB_OUTPUT"
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Restore dependencies
run: nuget restore PowerToys.sln
- name: Build version
run: msbuild src\common\version\
- name: Restore dependencies
run: msbuild src\modules\launcher\Wox.Infrastructure\ -t:Restore /p:Platform=${{matrix.platform}}
- name: Build
run: msbuild src\modules\launcher\Wox.Infrastructure\ /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:Version=${{env.PowerToys_Version}}.0 /p:Deterministic=true /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true
- uses: actions/upload-artifact@v4
with:
name: WoxInfrastructure-${{matrix.platform}}
path: .\${{matrix.platform}}\Release\WoxInfrastructure\
push:
runs-on: windows-latest
needs: build
steps:
- name: Version
run: echo "${{needs.build.outputs.PowerToys_Version}}"
- name: Checkout
uses: actions/checkout@v4
with:
path: main
- uses: actions/download-artifact@v4
with:
name: WoxInfrastructure-x64
path: PowerToys\x64\Release\WoxInfrastructure\
- uses: actions/download-artifact@v4
with:
name: WoxInfrastructure-ARM64
path: PowerToys\ARM64\Release\WoxInfrastructure\
- name: Downloaded artifacts
run: ls -R PowerToys
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Pack
run: dotnet build main -c Release /p:Version=${{needs.build.outputs.PowerToys_Version}}
- name: NuGet Push
run: dotnet nuget push main\bin\Release\*.nupkg --api-key "${{secrets.NUGET_APIKEY}}" --source https://api.nuget.org/v3/index.json --skip-duplicate