From 5737d20e8c913c492301fa899692049defdf57a3 Mon Sep 17 00:00:00 2001 From: tuxuser <462620+tuxuser@users.noreply.github.com> Date: Fri, 11 Sep 2020 20:22:50 +0200 Subject: [PATCH] Add multiplatform publishing (again) --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccf6fda..1839e59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,24 @@ jobs: run: dotnet test --no-restore --verbosity normal /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.SemVer }}-${{ steps.gitversion.outputs.ShortSha }} - name: Create publishable builds run: dotnet publish --no-restore --configuration Release /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.SemVer }}-${{ steps.gitversion.outputs.ShortSha }} + - name: Create publishable multi platform builds + shell: bash + run: | + for rid in linux-x64 win-x64 win-x86 osx-x64 + do + release_name="XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}-${rid}" + output_dir="release-${rid}" + + for proj in XVDTool XBFSTool DurangoKeyExtractor + do + dotnet publish --configuration Release ${proj}/${proj}.csproj /p:PublishSingleFile=true /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.SemVer }}-${{ steps.gitversion.outputs.ShortSha }} --self-contained false --framework netcoreapp3.1 --runtime "${rid}" -o "${output_dir}" + done + + # Pack files + 7z a -tzip "${release_name}.zip" "./${output_dir}/*" ./README.md ./xvd_info.md ./CHANGELOG.md + # Delete output directory + rm -r "$output_dir" + done - name: Copy files run: | mkdir ./release @@ -100,3 +118,10 @@ jobs: asset_path: ./XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}.zip asset_name: XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}.zip asset_content_type: application/zip + - name: Publish + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: softprops/action-gh-release@v1 + with: + files: "XVDTool-*.zip" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}