Update and rename dotnet.yml to Build binaries for release.yml

This commit is contained in:
Ivan Bushchik 2022-02-09 16:42:13 +03:00 committed by GitHub
parent 4cdab77cf1
commit ee5de7ee05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 62 deletions

View file

@ -0,0 +1,34 @@
name: .NET
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Prepare for building
run: mkdir prepublish && mkdir publish
- name: Publish on osx-x64
run: dotnet publish --runtime osx-x64 -o prepublish/osx-x64/ --self-contained -p:PublishSingleFile=true && mv prepublish/osx-x64/roulette publish/roulette-osx-x64
- name: Publish on linux-x64
run: dotnet publish --runtime linux-x64 -o prepublish/linux-x64/ --self-contained -p:PublishSingleFile=true && mv prepublish/linux-x64/roulette publish/roulette-linux-x64
- name: Publish on linux-arm64
run: dotnet publish --runtime linux-arm64 -o prepublish/linux-arm64/ --self-contained -p:PublishSingleFile=true && mv prepublish/linux-arm64/roulette publish/roulette-linux-arm64
- name: Upload To Github Release
uses: xresloader/upload-to-github-release@v1.3.2
with:
file: publish/roulette-osx-x64;publish/roulette-linux-x64;publish/roulette-linux-arm64
update_latest_release: true

View file

@ -1,62 +0,0 @@
name: .NET
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Prepare for publishing
run: mkdir prepublish && mkdir publish
- name: Publish on osx-x64
run: dotnet publish --runtime osx-x64 -o prepublish/osx-x64/ --self-contained -p:PublishSingleFile=true && mv prepublish/osx-x64/roulette publish/roulette-osx-x64
- name: Publish on linux-x64
run: dotnet publish --runtime linux-x64 -o prepublish/linux-x64/ --self-contained -p:PublishSingleFile=true && mv prepublish/linux-x64/roulette publish/roulette-linux-x64
- name: Publish on linux-arm64
run: dotnet publish --runtime linux-arm64 -o prepublish/linux-arm64/ --self-contained -p:PublishSingleFile=true && mv prepublish/linux-arm64/roulette publish/roulette-linux-arm64
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: EDITME
release_name: EDITME
draft: True
prerelease: False
- name: Upload Release Asset for osx-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: publish/roulette-osx-x64
asset_name: roulette-osx-x64
asset_content_type: application/octet-stream
- name: Upload Release Asset for linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: publish/roulette-linux-x64
asset_name: roulette-linux-x64
asset_content_type: application/octet-stream
- name: Upload Release Asset for linux-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: publish/roulette-linux-arm64
asset_name: roulette-linux-arm64
asset_content_type: application/octet-stream