Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-file .EXEs for Windows, Mac, and Linux (with self-contained versions) #39

Merged
merged 14 commits into from
Nov 24, 2022
45 changes: 39 additions & 6 deletions .github/workflows/build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,52 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
working-directory: "${{env.CODE_LOCATION}}"
- name: Build
run: dotnet build --no-restore
run: dotnet build -c Release --no-restore
working-directory: "${{env.CODE_LOCATION}}"
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test -c Release --no-build --verbosity normal
working-directory: "${{env.CODE_LOCATION}}"
- name: Publish Single-File .EXEs
working-directory: "${{env.CODE_LOCATION}}"
run: |
dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc false
dotnet publish -r osx-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc false
dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc false
- name: ZIP Single-File .EXEs
run: |
tar -cvf linux-x64.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/linux-x64/publish
tar -cvf osx-x64.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/osx-x64/publish
tar -cvf win-x64.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/win-x64/publish
- name: Clear the publish directories
run: |
rm -r ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/linux-x64/publish
rm -r ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/osx-x64/publish
rm -r ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/win-x64/publish
- name: Publish Self-Contained .EXEs
working-directory: "${{env.CODE_LOCATION}}"
run: |
dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc true
dotnet publish -r osx-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc true
dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc true
- name: ZIP Self-Contained .EXEs
run: |
tar -cvf linux-x64_selfcontained.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/linux-x64/publish
tar -cvf osx-x64_selfcontained.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/osx-x64/publish
tar -cvf win-x64_selfcontained.tar ${{env.CODE_LOCATION}}TFWhatsUp.Console/bin/Release/net7.0/win-x64/publish
- name: Pack
run: dotnet pack --no-build --verbosity normal
run: dotnet pack -c Release --no-build --verbosity normal
working-directory: "${{env.CODE_LOCATION}}/TFWhatsUp.Console"
- name: Save Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: "**/*.nupkg"
- name: Publish
path: |
"**/*.nupkg"
"**/linux-x64*.tar"
"**/osx-x64*.tar"
"**/win-x64*.tar"
- name: Publish Nuget
if: github.ref == 'refs/heads/main'
working-directory: "${{env.CODE_LOCATION}}/TFWhatsUp.Console/nupkg"
run: nuget push **/*.nupkg -Source 'https://api.nuget.org/v3/index.json'
Expand All @@ -70,4 +101,6 @@ jobs:
prerelease: false
fail_on_unmatched_files: true
generate_release_notes: true
files: "**/*.nupkg"
files: |
"**/*.nupkg"
"**/*.tar"