publish-windows #2
Workflow file for this run
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: publish-windows | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [ created ] | |
workflow_dispatch: | |
env: | |
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use | |
jobs: | |
publish: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Prepare build | |
run: | | |
mkdir release | |
- name: Build | |
run: | | |
dotnet build --configuration Release --no-restore | |
dotnet publish -c Release -o . -r win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:PublishTrimmed=true | |
cp Raxport.exe release/Raxport.exe | |
# cp README.md release/README.md | |
- name: Upload build artificats | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Raxport-windows | |
path: release/* | |
- name: Upload binaries to the release | |
uses: svenstaro/upload-release-action@v2 | |
# if: ${{ github.event_name == 'release' }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: release/* | |
overwrite: true | |
file_glob: true |