Desktop Publish #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Desktop Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
# Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/setup-msbuild@v2 | |
- name: Publish | |
run: dotnet publish -c Release -o ./publish WebTranslator/WebTranslator.Desktop | |
- name: Upload Windows Publish Directory | |
uses: actions/upload-artifact@v2 | |
with: | |
name: windows-publish | |
path: publish | |
build-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install clang zlib1g-dev | |
- name: Publish | |
run: dotnet publish -c Release -o ./publish WebTranslator/WebTranslator.Desktop | |
- name: Upload Ubuntu Publish Directory | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ubuntu-publish | |
path: publish | |
release: | |
needs: [build-windows, build-ubuntu] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Windows Publish Directory | |
uses: actions/download-artifact@v2 | |
with: | |
name: windows-publish | |
path: publish/windows | |
- name: Download Ubuntu Publish Directory | |
uses: actions/download-artifact@v2 | |
with: | |
name: ubuntu-publish | |
path: publish/ubuntu | |
- name: Rename and Clean Windows Files | |
run: | | |
mv publish/windows/WebTranslator/Desktop.exe publish/windows/WebTranslator.exe | |
rm -f publish/windows/WebTranslator.Desktop.pdb publish/windows/WebTranslator.pdb | |
- name: Package Windows Build | |
run: | | |
cd publish/windows | |
zip -r WebTranslator-windows_amd64.zip . | |
mv WebTranslator-windows_amd64.zip ../../ | |
cd ../.. | |
- name: Rename and Clean Ubuntu Files | |
run: | | |
mv publish/ubuntu/WebTranslator/Desktop publish/ubuntu/WebTranslator | |
rm -f publish/ubuntu/WebTranslator.Desktop.dbg publish/ubuntu/WebTranslator.pdb | |
- name: Package Ubuntu Build | |
run: | | |
cd publish/ubuntu | |
tar -czvf WebTranslator-linux_amd64.tar.gz . | |
mv WebTranslator-linux_amd64.tar.gz ../../ | |
cd ../.. | |
- name: List Final Artifacts | |
run: | | |
ls -l WebTranslator-windows_amd64.zip | |
ls -l WebTranslator-linux_amd64.tar.gz |