From 7b56ee96149291af3e34425db26258684a561fe0 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sat, 29 Oct 2022 21:51:21 +0200 Subject: [PATCH] Actions: do seperate workflow for publishing --- .github/workflows/build-and-publish.yml | 45 +++++++++++++++++++++++++ .github/workflows/build.yml | 8 ----- 2 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..fef1c9f --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,45 @@ +name: Build And Publish + +on: + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + configuration: [Release] + include: + - os: ubuntu-latest + COMMAND: AM2RLauncher.Gtk -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained + ARTIFACT: AM2RLauncher/AM2RLauncher.Gtk/bin/Release/net6.0/ubuntu.18.04-x64/publish/ + - os: macOS-latest + COMMAND: AM2RLauncher.Mac -r osx-x64 --no-self-contained + ARTIFACT: AM2RLauncher/AM2RLauncher.Mac/bin/Release/net6.0/osx-x64/AM2RLauncher.Mac.app/ + - os: windows-latest + COMMAND: AM2RLauncher.Wpf -r win-x86 -o builds\win86 + ARTIFACT: AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\ + runs-on: ${{ matrix.os }} + + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + working-directory: ./AM2RLauncher + run: dotnet restore + - name: Build + working-directory: ./AM2RLauncher + run: dotnet publish ${{ matrix.COMMAND }} -c "${{ matrix.configuration }}" + # Steps for uploading artifacts. + - name: Zip to Archive + run: 7z a -tzip ${{ matrix.os }}.zip ./${{ matrix.ARTIFACT }} + - name: Upload Artifacts + uses: actions/upload-artifact@v1.0.0 + with: + name: ${{ matrix.os }} + path: ${{ matrix.os }}.zip diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e109750..77a83f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,11 +45,3 @@ jobs: - name: Build working-directory: ./AM2RLauncher run: dotnet publish ${{ matrix.COMMAND }} -c "${{ matrix.configuration }}" - # Steps for uploading artifacts. - - name: Zip to Archive - run: 7z a -tzip ${{ matrix.os }}.zip ./${{ matrix.ARTIFACT }} - - name: Upload Artifacts - uses: actions/upload-artifact@v1.0.0 - with: - name: ${{ matrix.os }} - path: ${{ matrix.os }}.zip