Skip to content

Commit

Permalink
Merge pull request #2 from TheEightBot/feature/update-build
Browse files Browse the repository at this point in the history
feat: Update NuGet workflow
  • Loading branch information
michaelstonis authored Oct 19, 2023
2 parents 525d92c + ceaecfc commit c178c42
Showing 1 changed file with 47 additions and 32 deletions.
79 changes: 47 additions & 32 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,52 @@

name: .NET

on:
push:
tags:
- 'v**'
on:
push:
tags:
- "v**"

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
source-url: https://nuget.pkg.github.com/theeightbot/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install MAUI Workloads
run: dotnet workload install maui --ignore-failed-sources

- name: Semver Parse
id: version
uses: release-kit/[email protected]

- name: Build Aurora Controls MAUI
run: dotnet build AuroraControlsMaui/AuroraControls.csproj

- name: Create the package
run: dotnet pack --configuration Release /p:AssemblyVersion=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} /p:Version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} AuroraControlsMaui/AuroraControls.csproj

- name: Publish the package to GPR
run: dotnet nuget push AuroraControlsMaui/bin/Release/*.nupkg
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.x"
source-url: https://nuget.pkg.github.com/theeightbot/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install MAUI Workloads
run: dotnet workload install maui --ignore-failed-sources

- name: Semver Parse
id: version
uses: release-kit/[email protected]

- name: Build Aurora Controls MAUI
run: dotnet build AuroraControlsMaui/AuroraControls.Maui.csproj

- name: Create the package
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} /p:AssemblyVersion=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} /p:Version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} AuroraControlsMaui/AuroraControls.Maui.csproj

- name: Publish the package to GPR
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file
}
# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v3
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

0 comments on commit c178c42

Please sign in to comment.