Build Package #19
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: Build Package | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ x64 , ARM64 ] | |
runs-on: windows-latest | |
env: | |
OUTPUT_PATH: src\Community.PowerToys.Run.Plugin.UnicodeInput\bin # why does it need this? | |
PLUGIN_NAME: UnicodeInput | |
DOTNET_VER: net8.0-windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Read Version | |
run: | | |
echo "PLUGIN_VERSION=$(git describe --tags --dirty --candidates 1 --always)" >> $env:GITHUB_ENV | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore the application | |
run: dotnet restore | |
working-directory: src | |
- name: Execute unit tests | |
run: dotnet test | |
working-directory: src | |
- name: Build the application | |
run: dotnet build --configuration RELEASE /p:Platform=${{matrix.platform}} /p:EnableWindowsTargeting=true | |
working-directory: src | |
- name: Prepare the artifact | |
run: | | |
Remove-Item -Path ${{ env.OUTPUT_PATH }}\* -Recurse -Include *.xml, *.pdb, PowerToys.*, Wox.* | |
Move-Item -Path ${{ env.OUTPUT_PATH }}\${{ matrix.platform }}\Release\${{ env.DOTNET_VER }} -Destination ${{ env.OUTPUT_PATH }}\${{ matrix.platform }}\Release\UnicodeInput | |
Compress-Archive -Path ${{ env.OUTPUT_PATH }}\${{ matrix.platform }}\Release\UnicodeInput -DestinationPath "${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}-${{ matrix.platform }}.zip" | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}-${{ matrix.platform }}.zip | |
- name: Upload the artifact(s) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip | |
path: ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}-*.zip | |
- name: Create a release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: | | |
${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}-*.zip | |
# - name: Debug with tmate on failure | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 |