Merge pull request #121 from cwensley/update-buiild #101
Workflow file for this run
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
branches: [main] | |
env: | |
DotNetVersion: "9.0.x" | |
BuildConfiguration: "Release" | |
BuildParameters: "/clp:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}" | |
jobs: | |
build-windows: | |
strategy: | |
matrix: | |
arch: [win-x64, win-arm64] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Build PabloDraw | |
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-${{ matrix.arch }}.binlog | |
- name: Build PabloDraw.Console | |
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-${{ matrix.arch }}.binlog | |
- name: Build msi | |
run: dotnet build -r:${{ matrix.arch }} ${{ env.BuildParameters }} /p:PublishReferences=False Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pablodraw-binaries-${{ matrix.arch }} | |
path: artifacts/publish/${{ env.BuildConfiguration }}/${{ matrix.arch }}/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pablodraw-installer-${{ matrix.arch }} | |
path: artifacts/installer/${{ env.BuildConfiguration }}/${{ matrix.arch }}/*.msi | |
- name: Upload log files | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: log-${{ matrix.arch }} | |
path: artifacts/log/**/* | |
build-linux: | |
strategy: | |
matrix: | |
arch: [linux-x64, linux-arm64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- name: Build PabloDraw | |
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-${{ matrix.arch }}.binlog | |
- name: Create gzip | |
run: tar -czvf pablodraw-${{ matrix.arch }}.tar.gz -C artifacts/publish/${{ env.BuildConfiguration }}/${{ matrix.arch }} . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pablodraw-binaries-${{ matrix.arch }} | |
path: pablodraw-${{ matrix.arch }}.tar.gz | |
- name: Upload log files | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: log-${{ matrix.arch }} | |
path: artifacts/log/**/* | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DotNetVersion }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Import code signing certificate | |
if: github.event_name != 'pull_request' | |
uses: apple-actions/import-codesign-certs@v3 | |
with: | |
p12-file-base64: ${{ secrets.DEVID_CERTIFICATE_P12 }} | |
p12-password: ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }} | |
- name: Enable code signing | |
if: github.event_name != 'pull_request' | |
run: echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSigning=True" >> $GITHUB_ENV | |
- name: Set notarization credentials | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
xcrun notarytool store-credentials "AC_PASSWORD" --apple-id "${{ secrets.AC_USERNAME }}" --team-id "${{ secrets.AC_TEAMID }}" --password "${{ secrets.AC_PASSWORD }}" | |
echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarization=True" >> $GITHUB_ENV | |
- name: Build PabloDraw | |
run: sudo dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pablodraw-mac | |
path: artifacts/publish/${{ env.BuildConfiguration }}/Mac/*.dmg | |
- name: Upload log files | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: log-mac | |
path: artifacts/log/**/* | |
update-release: | |
needs: [build-windows, build-mac, build-linux] | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
steps: | |
- id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | |
- uses: actions/download-artifact@v4 | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
**/*.msi | |
**/*.dmg | |
**/*.tar.gz |