From 78fd09aa91e33c5ff7b6211862ec5681c320e021 Mon Sep 17 00:00:00 2001 From: pixil98 <46978190+pixil98@users.noreply.github.com> Date: Tue, 22 Nov 2022 10:45:33 -0600 Subject: [PATCH] Proper build Builds all packages properly --- .github/workflows/dotnet-build.yml | 58 +++++++++++++++++++ .github/workflows/dotnet-publish.yml | 47 ++++----------- .github/workflows/dotnet-validate.yml | 24 ++------ .releaseindex.json | 8 +-- .../PublishProfiles/LinuxProfile.pubxml | 2 +- .../PublishProfiles/MacOSProfile.pubxml | 2 +- .../PublishProfiles/WindowsProfile.pubxml | 2 +- .../PublishProfiles/LinuxProfile.pubxml | 2 +- .../PublishProfiles/MacOSProfile.pubxml | 2 +- .../PublishProfiles/WindowsProfile.pubxml | 2 +- .../PublishProfiles/LinuxProfile.pubxml | 2 +- .../PublishProfiles/MacOSProfile.pubxml | 2 +- .../PublishProfiles/WindowsProfile.pubxml | 2 +- .../PublishProfiles/LinuxProfile.pubxml | 2 +- .../PublishProfiles/MacOSProfile.pubxml | 2 +- 15 files changed, 89 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/dotnet-build.yml diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml new file mode 100644 index 00000000..3214f625 --- /dev/null +++ b/.github/workflows/dotnet-build.yml @@ -0,0 +1,58 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: build + +on: + workflow_call: + inputs: + version: + type: string + description: 'Libation version' + required: true + +env: + DOTNET_VERSION: '7' # The .NET SDK version to use + DOTNET_CONFIGURATION: 'Release' + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + os: [Linux, MacOS, Windows] + ui: [Avalonia] + release_name: [chardonnay] + include: + - os: Windows + ui: WinForms + release_name: classic + steps: + - name: Lowercase os + run: | + echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build + working-directory: ./Source + run: | + dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} Libation${{ matrix.ui }}\Libation${{ matrix.ui }}.csproj -p:PublishProfile=Libation${{ matrix.ui }}\Properties\PublishProfiles\${{ matrix.os }}Profile.pubxml + dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} LoadByOS\${{ matrix.os }}ConfigApp\${{ matrix.os }}ConfigApp.csproj -p:PublishProfile=LoadByOS\${{ matrix.os }}ConfigApp\PublishProfiles\${{ matrix.os }}Profile.pubxml + dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} LibationCli\LibationCli.csproj -p:PublishProfile=LibationCli\Properties\PublishProfiles\${{ matrix.os }}Profile.pubxml + dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} Hangover${{ matrix.ui }}\Hangover${{ matrix.ui }}.csproj -p:PublishProfile=Hangover${{ matrix.ui }}\Properties\PublishProfiles\${{ matrix.os }}Profile.pubxml + - name: Rename release folder + working-directory: ./Source + run: ren ./bin/Publish/${{ matrix.os }}-${{ matrix.release_name }} Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} + - name: Zip artifact + run: Compress-Archive ./Source/bin/Publish/Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.zip + - name: Publish artifact + uses: actions/upload-artifact@v3 + with: + name: Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} + path: Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.zip + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/dotnet-publish.yml b/.github/workflows/dotnet-publish.yml index 79025913..09414e93 100644 --- a/.github/workflows/dotnet-publish.yml +++ b/.github/workflows/dotnet-publish.yml @@ -9,31 +9,15 @@ on: - 'v*' env: - DOTNET_VERSION: '6.0.x' # The .NET SDK version to use - DOTNET_SLN: './Source/Libation.sln' + DOTNET_VERSION: '7' # The .NET SDK version to use + DOTNET_SOURCE: './Source' DOTNET_CONFIGURATION: 'Release' jobs: build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - env: - NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Restore dependencies - run: dotnet restore ${{ env.DOTNET_SLN }} - - name: Build - run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ env.DOTNET_SLN }} - - name: Publish Artifact - uses: actions/upload-artifact@v3 - with: - name: LibationZip - path: ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/ - if-no-files-found: error + uses: ./.github/workflows/dotnet-build.yml + with: + version: ${{ github.ref_name }} publish: needs: build @@ -42,11 +26,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v3 with: - name: LibationZip - path: ./Libation-${{ github.ref_name }} - - name: Zip Artifact - run: zip -r Libation.${{ github.ref_name }}.zip ./Libation-${{ github.ref_name }} - + path: artifacts - name: Create release id: create_release uses: actions/create-release@v1 @@ -56,16 +36,13 @@ jobs: tag_name: ${{ github.ref }} release_name: Libation ${{ github.ref }} body: - draft: false + draft: true prerelease: false - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 + - name: Upload Release Assets + id: upload-release-assets + uses: dwenegar/upload-release-assets@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Libation.${{ github.ref_name }}.zip - asset_name: Libation.${{ github.ref_name }}.zip - asset_content_type: application/zip \ No newline at end of file + release_id: ${{ steps.create_release.outputs.id }} + assets_path: ./artifacts \ No newline at end of file diff --git a/.github/workflows/dotnet-validate.yml b/.github/workflows/dotnet-validate.yml index 87fca7ea..9b32845f 100644 --- a/.github/workflows/dotnet-validate.yml +++ b/.github/workflows/dotnet-validate.yml @@ -10,28 +10,12 @@ on: branches: [ "master" ] env: - DOTNET_VERSION: '6.0.x' # The .NET SDK version to use + DOTNET_VERSION: '7' # The .NET SDK version to use DOTNET_SLN: './Source/Libation.sln' DOTNET_CONFIGURATION: 'Release' jobs: build: - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Restore dependencies - run: dotnet restore ${{ env.DOTNET_SLN }} - - - name: Build - run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ env.DOTNET_SLN }} - - - name: Test - run: dotnet test --configuration ${{ env.DOTNET_CONFIGURATION }} --no-build --verbosity normal ${{ env.DOTNET_SLN }} - \ No newline at end of file + uses: ./.github/workflows/dotnet-build.yml + with: + version: ${{ github.sha }} \ No newline at end of file diff --git a/.releaseindex.json b/.releaseindex.json index d3a35438..c9b05167 100644 --- a/.releaseindex.json +++ b/.releaseindex.json @@ -1,6 +1,6 @@ { - "WindowsClassic": "Libation\\.\\d+\\.\\d+\\.\\d+-win-classic\\.zip", - "WindowsAvalonia":"Libation\\.\\d+\\.\\d+\\.\\d+-win-chardonnay\\.zip", - "LinuxAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+-linux-chardonnay", - "MacOSAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+-macos-chardonnay" + "WindowsClassic": "Libation\\.v\\d+\\.\\d+\\.\\d+-Windows-chardonnay\\.zip", + "WindowsAvalonia":"Libation\\.v\\d+\\.\\d+\\.\\d+-Windows-chardonnay\\.zip", + "LinuxAvalonia": "Libation\\.v\\d+\\.\\d+\\.\\d+-Linux-chardonnay", + "MacOSAvalonia": "Libation\\.v\\d+\\.\\d+\\.\\d+-MacOS-chardonnay" } diff --git a/Source/HangoverAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml b/Source/HangoverAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml index 9b2a3ee4..cd35f42e 100644 --- a/Source/HangoverAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml +++ b/Source/HangoverAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\linux-chardonnay + ..\bin\Publish\Linux-chardonnay FileSystem net6.0 linux-x64 diff --git a/Source/HangoverAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml b/Source/HangoverAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml index 375935b6..53a83413 100644 --- a/Source/HangoverAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml +++ b/Source/HangoverAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\macos-chardonnay + ..\bin\Publish\MacOS-chardonnay FileSystem net6.0 osx-x64 diff --git a/Source/HangoverAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml b/Source/HangoverAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml index bdce48eb..8f28c798 100644 --- a/Source/HangoverAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml +++ b/Source/HangoverAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\win-chardonnay + ..\bin\Publish\Windows-chardonnay FileSystem net6.0 win-x64 diff --git a/Source/LibationAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml b/Source/LibationAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml index 9b2a3ee4..cd35f42e 100644 --- a/Source/LibationAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml +++ b/Source/LibationAvalonia/Properties/PublishProfiles/LinuxProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\linux-chardonnay + ..\bin\Publish\Linux-chardonnay FileSystem net6.0 linux-x64 diff --git a/Source/LibationAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml b/Source/LibationAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml index 375935b6..53a83413 100644 --- a/Source/LibationAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml +++ b/Source/LibationAvalonia/Properties/PublishProfiles/MacOSProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\macos-chardonnay + ..\bin\Publish\MacOS-chardonnay FileSystem net6.0 osx-x64 diff --git a/Source/LibationAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml b/Source/LibationAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml index bdce48eb..8f28c798 100644 --- a/Source/LibationAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml +++ b/Source/LibationAvalonia/Properties/PublishProfiles/WindowsProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\win-chardonnay + ..\bin\Publish\Windows-chardonnay FileSystem net6.0 win-x64 diff --git a/Source/LibationCli/Properties/PublishProfiles/LinuxProfile.pubxml b/Source/LibationCli/Properties/PublishProfiles/LinuxProfile.pubxml index 9b2a3ee4..cd35f42e 100644 --- a/Source/LibationCli/Properties/PublishProfiles/LinuxProfile.pubxml +++ b/Source/LibationCli/Properties/PublishProfiles/LinuxProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\linux-chardonnay + ..\bin\Publish\Linux-chardonnay FileSystem net6.0 linux-x64 diff --git a/Source/LibationCli/Properties/PublishProfiles/MacOSProfile.pubxml b/Source/LibationCli/Properties/PublishProfiles/MacOSProfile.pubxml index 375935b6..53a83413 100644 --- a/Source/LibationCli/Properties/PublishProfiles/MacOSProfile.pubxml +++ b/Source/LibationCli/Properties/PublishProfiles/MacOSProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\macos-chardonnay + ..\bin\Publish\MacOS-chardonnay FileSystem net6.0 osx-x64 diff --git a/Source/LibationCli/Properties/PublishProfiles/WindowsProfile.pubxml b/Source/LibationCli/Properties/PublishProfiles/WindowsProfile.pubxml index bdce48eb..8f28c798 100644 --- a/Source/LibationCli/Properties/PublishProfiles/WindowsProfile.pubxml +++ b/Source/LibationCli/Properties/PublishProfiles/WindowsProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\bin\Publish\win-chardonnay + ..\bin\Publish\Windows-chardonnay FileSystem net6.0 win-x64 diff --git a/Source/LoadByOS/LinuxConfigApp/PublishProfiles/LinuxProfile.pubxml b/Source/LoadByOS/LinuxConfigApp/PublishProfiles/LinuxProfile.pubxml index 87456e98..034694b5 100644 --- a/Source/LoadByOS/LinuxConfigApp/PublishProfiles/LinuxProfile.pubxml +++ b/Source/LoadByOS/LinuxConfigApp/PublishProfiles/LinuxProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\..\bin\Publish\linux-chardonnay + ..\..\bin\Publish\Linux-chardonnay FileSystem net6.0 linux-x64 diff --git a/Source/LoadByOS/MacOSConfigApp/PublishProfiles/MacOSProfile.pubxml b/Source/LoadByOS/MacOSConfigApp/PublishProfiles/MacOSProfile.pubxml index 7d7e53ee..6322c994 100644 --- a/Source/LoadByOS/MacOSConfigApp/PublishProfiles/MacOSProfile.pubxml +++ b/Source/LoadByOS/MacOSConfigApp/PublishProfiles/MacOSProfile.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\..\bin\Publish\macos-chardonnay + ..\..\bin\Publish\MacOS-chardonnay FileSystem net6.0 osx-x64