Skip to content

Commit 5737d20

Browse files
committed
Add multiplatform publishing (again)
1 parent 1b5ef7a commit 5737d20

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@ jobs:
6363
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 }}
6464
- name: Create publishable builds
6565
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 }}
66+
- name: Create publishable multi platform builds
67+
shell: bash
68+
run: |
69+
for rid in linux-x64 win-x64 win-x86 osx-x64
70+
do
71+
release_name="XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}-${rid}"
72+
output_dir="release-${rid}"
73+
74+
for proj in XVDTool XBFSTool DurangoKeyExtractor
75+
do
76+
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}"
77+
done
78+
79+
# Pack files
80+
7z a -tzip "${release_name}.zip" "./${output_dir}/*" ./README.md ./xvd_info.md ./CHANGELOG.md
81+
# Delete output directory
82+
rm -r "$output_dir"
83+
done
6684
- name: Copy files
6785
run: |
6886
mkdir ./release
@@ -100,3 +118,10 @@ jobs:
100118
asset_path: ./XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}.zip
101119
asset_name: XVDTool-${{ steps.gitversion.outputs.assemblySemVer }}.zip
102120
asset_content_type: application/zip
121+
- name: Publish
122+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
123+
uses: softprops/action-gh-release@v1
124+
with:
125+
files: "XVDTool-*.zip"
126+
env:
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)