Skip to content

publish.yml: Publish build for all platforms. #6

publish.yml: Publish build for all platforms.

publish.yml: Publish build for all platforms. #6

Workflow file for this run

name: Publish
on:
push:
tags:
- '*'
permissions: write-all
jobs:
create_release:
runs-on: windows-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
build:
needs: create_release
strategy:
matrix:
platform: [x64, x86, ARM64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Restore
run: msbuild pbench.sln /t:restore /p:Configuration=Release /p:Platform=${{ matrix.platform }}
- name: Build
run: msbuild pbench.sln /t:build /p:Configuration=Release /p:Platform=${{ matrix.platform }} /p:RestorePackages=false
- name: Upload pbench.msi to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: .\_bin\Release-${{ matrix.platform }}\en-US\pbench.msi
asset_name: pbench-${{ matrix.platform }}.msi
asset_content_type: application/msi
- name: Upload pbench.exe to Release
if: ${{ matrix.platform }} == 'x86'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: .\_bin\Release-${{ matrix.platform }}\pbench.exe
asset_name: pbench.exe
asset_content_type: application/exe