From 9e16ae568d166165e267542ba178cec0a3c140f5 Mon Sep 17 00:00:00 2001 From: Steve John Date: Mon, 1 Jul 2024 09:45:34 +0100 Subject: [PATCH] Publish on push --- .github/workflows/publish-all.yml | 30 ++++++++++++++++++++++++++++++ publish.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/publish-all.yml create mode 100755 publish.sh diff --git a/.github/workflows/publish-all.yml b/.github/workflows/publish-all.yml new file mode 100644 index 00000000..b73f02b1 --- /dev/null +++ b/.github/workflows/publish-all.yml @@ -0,0 +1,30 @@ +# 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 Artifacts and Release + +on: + push: + tags: + - "v*.*.*" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Publish and Zip all. + run: ./publish.sh + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + Zen.Desktop.Host.Windows.Intel.zip + Zen.Desktop.Host.macOS.Apple.zip + Zen.Desktop.Host.macOS.Intel.zip \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100755 index 00000000..61dad789 --- /dev/null +++ b/publish.sh @@ -0,0 +1,26 @@ +rm *.zip +dotnet publish ./src/Zen.Desktop.Host/Zen.Desktop.Host.csproj -c Release -r osx-x64 /p:PublishReadyToRun=true /p:TieredCompilation=false --self-contained /p:PublishReadyToRunShowWarnings=true +dotnet publish ./src/Zen.Desktop.Host/Zen.Desktop.Host.csproj -c Release -r osx-arm64 /p:PublishReadyToRun=true /p:TieredCompilation=false --self-contained /p:PublishReadyToRunShowWarnings=true +dotnet publish ./src/Zen.Desktop.Host/Zen.Desktop.Host.csproj -c Release -r win-x64 /p:PublishReadyToRun=true /p:TieredCompilation=false --self-contained /p:PublishReadyToRunShowWarnings=true +cd ./src/Zen.Desktop.Host/bin/Release/net8.0/osx-x64/publish +pwd +chmod +xx Zen.Desktop.Host +rm *.zip +zip -r Zen.Desktop.Host.macOS.Intel.zip * +cd - +mv ./src/Zen.Desktop.Host/bin/Release/net8.0/osx-x64/publish/Zen.Desktop.Host.macOS.Intel.zip . + +cd ./src/Zen.Desktop.Host/bin/Release/net8.0/osx-arm64/publish +pwd +chmod +xx Zen.Desktop.Host +rm *.zip +zip -r Zen.Desktop.Host.macOS.Apple.zip * +cd - +mv ./src/Zen.Desktop.Host/bin/Release/net8.0/osx-arm64/publish/Zen.Desktop.Host.macOS.Apple.zip . + +cd ./src/Zen.Desktop.Host/bin/Release/net8.0/win-x64/publish +pwd +rm *.zip +zip -r Zen.Desktop.Host.Windows.Intel.zip * +cd - +mv ./src/Zen.Desktop.Host/bin/Release/net8.0/win-x64/publish/Zen.Desktop.Host.Windows.Intel.zip .