Skip to content

Commit

Permalink
Move Workflows to trigger on Release
Browse files Browse the repository at this point in the history
  • Loading branch information
hydratim committed Aug 6, 2024
1 parent 8151755 commit a7d4454
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Build Mac

on:
push:
branches: [ "main" ]
release:
types: [created]

jobs:
build:
runs-on: macos-latest

permissions:
packages: write
contents: read
env:
Solution_Name: OpenOTDR
CS_Project_Directory: OpenOTDR
Expand All @@ -24,13 +27,19 @@ jobs:
with:
dotnet-version: 8.0.x

- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV

- name: Install MAUI Workloads
run: |
dotnet workload install maccatalyst --ignore-failed-sources
dotnet workload install maui --ignore-failed-sources
- name: Build MAUI MacCatalyst
run: dotnet publish ${{ env.CS_Project_Path }} -c Release -f net8.0-maccatalyst -p:BuildIpa=True
run: dotnet publish /p:Version=$VERSION ${{ env.CS_Project_Path }} -c Release -f net8.0-maccatalyst -p:BuildIpa=True

- name: Upload MacCatalyst Artifact
uses: actions/upload-artifact@v2.3.1
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
jobs:
build:
runs-on: windows-latest

permissions:
packages: write
contents: read

env:
Solution_Name: OpenOTDR
Expand All @@ -24,6 +28,12 @@ jobs:
with:
dotnet-version: 8.0.x

- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
Expand All @@ -33,7 +43,7 @@ jobs:
run: dotnet workload install maui

- name: Build the application
run: dotnet publish -f net8.0-windows10.0.22621.0 -c Release -p:WindowsPackageType=None -p:PublishSingleFile=true -o ${{ env.CS_Project_Directory }}\AppPackages --self-contained
run: dotnet publish /p:Version=$VERSION -f net8.0-windows10.0.22621.0 -c Release -p:WindowsPackageType=None -p:PublishSingleFile=true -o ${{ env.CS_Project_Directory }}\AppPackages --self-contained

- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit a7d4454

Please sign in to comment.