roulette/.github/workflows/dotnet.yml

49 lines
1.5 KiB
YAML
Raw Normal View History

2021-04-24 22:36:28 +03:00
name: .NET
2022-01-13 12:12:41 +03:00
on: workflow_dispatch
2021-04-24 22:36:28 +03:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
2022-01-12 19:19:36 +03:00
dotnet-version: 6.0.x
2021-04-24 22:36:28 +03:00
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
2022-01-13 12:12:41 +03:00
- name: Publish on osx-x64
2022-01-13 12:24:54 +03:00
run: dotnet publish --runtime osx-x64 -o publish/osx-x64/ --self-contained
2022-01-13 12:12:41 +03:00
- name: Publish on linux-x64
2022-01-13 12:24:54 +03:00
run: dotnet publish --runtime linux-x64 -o publish/linux-x64/ --self-contained
2022-01-13 12:12:41 +03:00
- name: Publish on linux-arm64
2022-01-13 12:26:23 +03:00
run: dotnet publish --runtime linux-arm64 -o publish/linux-arm64/ --self-contained
2022-01-13 12:12:41 +03:00
- name: Compress to zip file
run: tar cf roulette.tar.gz publish/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: True
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./roulette.tar.gz
asset_name: roulette.tar.gz
asset_content_type: application/gzip