From 343983f657642d1ad046c7f402cd968571adf441 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:53:05 +0100 Subject: [PATCH 1/4] Initial actions test --- .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..572a41b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: Build and Upload + +on: + push: + paths-ignore: + - 'README.md' + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + configuration: [Release] + include: + - os: ubuntu-latest + COMMAND: AM2RModPacker -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained -o builds/ubuntu-latest + ARTIFACT: AM2RModPacker/builds/ubuntu-latest + POSTBUILD: echo "No post build to do!" + - os: macOS-latest + COMMAND: AM2RModPacker -r osx-x64 --no-self-contained -o builds/macOS-latest + ARTIFACT: AM2RModPacker/builds/macOS-latest + POSTBUILD: echo "No post build to do!" + - os: windows-latest + COMMAND: AM2RModPacker -r win-x86 + ARTIFACT: AM2RModPacker\bin\Release\net6\win-x86\ + # This is very ugly, *please* tell me a better way to do this + #POSTBUILD: mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe && mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe.config AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe.config && rmdir AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\publish -Recurse + 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 + run: dotnet restore + - name: Build + run: dotnet publish ${{ matrix.COMMAND }} -c "${{ matrix.configuration }}" + - name: Post-Build + run: | + cp ./LICENSE ./${{ matrix.ARTIFACT }}/ + ${{ matrix.POSTBUILD }} + # 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 From 07d2d1429451a966d2ade8052369a35c093168f6 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:57:28 +0100 Subject: [PATCH 2/4] Try more --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 572a41b..f6803ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,17 +16,18 @@ jobs: include: - os: ubuntu-latest COMMAND: AM2RModPacker -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained -o builds/ubuntu-latest - ARTIFACT: AM2RModPacker/builds/ubuntu-latest + ARTIFACT: builds/ubuntu-latest POSTBUILD: echo "No post build to do!" - os: macOS-latest COMMAND: AM2RModPacker -r osx-x64 --no-self-contained -o builds/macOS-latest - ARTIFACT: AM2RModPacker/builds/macOS-latest + ARTIFACT: builds/macOS-latest POSTBUILD: echo "No post build to do!" - os: windows-latest - COMMAND: AM2RModPacker -r win-x86 - ARTIFACT: AM2RModPacker\bin\Release\net6\win-x86\ + COMMAND: AM2RModPacker -r win-x86 --no-self-contained -o builds/windows-latest + ARTIFACT: builds/windows-latest # This is very ugly, *please* tell me a better way to do this #POSTBUILD: mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe && mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe.config AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe.config && rmdir AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\publish -Recurse + POSTBUILD: echo "No post build to do!" runs-on: ${{ matrix.os }} From 823f938c25b7c3bdfc5f40e2066527e4a53b2dfd Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:59:20 +0100 Subject: [PATCH 3/4] not fail linux --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6803ca..f3dc711 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: configuration: [Release] include: - os: ubuntu-latest - COMMAND: AM2RModPacker -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained -o builds/ubuntu-latest + COMMAND: AM2RModPacker -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained -o builds/ubuntu-latest -p:BuildPlatform=Gtk ARTIFACT: builds/ubuntu-latest POSTBUILD: echo "No post build to do!" - os: macOS-latest From e307d91757c32032ca64ae7480ca355e8e1051fe Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:05:21 +0100 Subject: [PATCH 4/4] Clean workflow file --- .github/workflows/main.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3dc711..3eb8eee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,17 +17,12 @@ jobs: - os: ubuntu-latest COMMAND: AM2RModPacker -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained -o builds/ubuntu-latest -p:BuildPlatform=Gtk ARTIFACT: builds/ubuntu-latest - POSTBUILD: echo "No post build to do!" - os: macOS-latest COMMAND: AM2RModPacker -r osx-x64 --no-self-contained -o builds/macOS-latest ARTIFACT: builds/macOS-latest - POSTBUILD: echo "No post build to do!" - os: windows-latest - COMMAND: AM2RModPacker -r win-x86 --no-self-contained -o builds/windows-latest + COMMAND: AM2RModPacker -p:PublishSingleFile=true -r win-x86 --no-self-contained -o builds/windows-latest ARTIFACT: builds/windows-latest - # This is very ugly, *please* tell me a better way to do this - #POSTBUILD: mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe && mv AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.Wpf.exe.config AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\AM2RLauncher.exe.config && rmdir AM2RLauncher\AM2RLauncher.Wpf\bin\Release\net48\win-x86\publish -Recurse - POSTBUILD: echo "No post build to do!" runs-on: ${{ matrix.os }} @@ -42,9 +37,7 @@ jobs: - name: Build run: dotnet publish ${{ matrix.COMMAND }} -c "${{ matrix.configuration }}" - name: Post-Build - run: | - cp ./LICENSE ./${{ matrix.ARTIFACT }}/ - ${{ matrix.POSTBUILD }} + run: cp ./LICENSE ./${{ matrix.ARTIFACT }}/ # Steps for uploading artifacts. - name: Zip to Archive run: 7z a -tzip ${{ matrix.os }}.zip ./${{ matrix.ARTIFACT }}