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

Simplify (and maybe fix?) build #40

Merged
merged 5 commits into from
Nov 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions .github/workflows/build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ on:
workflow_dispatch:

env:
CODE_LOCATION: src/
CODE_LOCATION: /home/runner/work/tf-whatsup/tf-whatsup/src/
CONSOLE_PROJECT_LOCATION: /home/runner/work/tf-whatsup/tf-whatsup/src/TFWhatsUp.Console/
RELEASE_LOCATION: /home/runner/work/tf-whatsup/tf-whatsup/src/TFWhatsUp.Console/bin/Release/net7.0/
PUBLISH_COMMAND_FLAGS: "-c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc false"
PUBLISH_COMMAND_FLAGS_SC: "-c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true --sc true"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -35,48 +39,52 @@ jobs:
- name: Restore tools
run: dotnet tool restore
working-directory: "${{env.CODE_LOCATION}}"
- name: Output Anticipated Version Number
- name: Set Version Number
working-directory: "${{env.CODE_LOCATION}}"
run: |
VERSION=$(dotnet minver -t v -v e)
echo "$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
working-directory: "${{env.CODE_LOCATION}}"
- name: Build
run: dotnet build -c Release --no-restore
working-directory: "${{env.CODE_LOCATION}}"
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
working-directory: "${{env.CODE_LOCATION}}"
run: dotnet test -c Release --no-build --verbosity normal
- 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
dotnet publish -r linux-x64 ${{env.PUBLISH_COMMAND_FLAGS}}
dotnet publish -r osx-x64 ${{env.PUBLISH_COMMAND_FLAGS}}
dotnet publish -r win-x64 ${{env.PUBLISH_COMMAND_FLAGS}}
- name: ZIP Single-File .EXEs
working-directory: "${{env.CODE_LOCATION}}"
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
tar -cvf linux-x64.tar ${{env.RELEASE_LOCATION}}linux-x64/publish
tar -cvf osx-x64.tar ${{env.RELEASE_LOCATION}}osx-x64/publish
tar -cvf win-x64.tar ${{env.RELEASE_LOCATION}}win-x64/publish
ls ./*.*
- 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
rm -rf ${{env.RELEASE_LOCATION}}linux-x64/publish
rm -rf ${{env.RELEASE_LOCATION}}osx-x64/publish
rm -rf ${{env.RELEASE_LOCATION}}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
dotnet publish -r linux-x64 ${{env.PUBLISH_COMMAND_FLAGS_SC}}
dotnet publish -r osx-x64 ${{env.PUBLISH_COMMAND_FLAGS_SC}}
dotnet publish -r win-x64 ${{env.PUBLISH_COMMAND_FLAGS_SC}}
- name: ZIP Self-Contained .EXEs
working-directory: "${{env.CODE_LOCATION}}"
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
tar -cvf linux-x64_selfcontained.tar ${{env.RELEASE_LOCATION}}linux-x64/publish
tar -cvf osx-x64_selfcontained.tar ${{env.RELEASE_LOCATION}}osx-x64/publish
tar -cvf win-x64_selfcontained.tar ${{env.RELEASE_LOCATION}}win-x64/publish
ls ./*.*
- name: Pack
run: dotnet pack -c Release --no-build --verbosity normal
working-directory: "${{env.CODE_LOCATION}}/TFWhatsUp.Console"
run: dotnet pack -c Release --no-build --verbosity normal
- name: Save Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
Expand Down