* Add dotnet test workflow * main -> master * Try a different workflow * Add working-directory * use windows runner * use env var * Fix build and test order * Specify configuration * Specify sln instead of working dir * Specify that DOTNET_SLN is an env var * Add publish workflow * Add env.DOTNET_SLN to publish workflow * Add publish job * Combine publish into one job * Just create an artifact * Remove unused nuget lines * Add Publish job back Co-authored-by: Aaron Reisman <areisman@epic.com>
71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
# This workflow will build a .NET project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
|
|
|
|
name: publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
env:
|
|
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
|
|
DOTNET_SLN: './Source/Libation.sln'
|
|
DOTNET_CONFIGURATION: 'Release'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
env:
|
|
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Restore dependencies
|
|
run: dotnet restore ${{ env.DOTNET_SLN }}
|
|
- name: Build
|
|
run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ env.DOTNET_SLN }}
|
|
- name: Publish Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: LibationZip
|
|
path: ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/
|
|
if-no-files-found: error
|
|
|
|
publish:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: LibationZip
|
|
path: ./Libation-${{ github.ref_name }}
|
|
- name: Zip Artifact
|
|
run: zip -r Libation.${{ github.ref_name }}.zip ./Libation-${{ github.ref_name }}
|
|
|
|
- name: Create release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Libation ${{ github.ref }}
|
|
body: <Put a body here>
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- 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: Libation.${{ github.ref_name }}.zip
|
|
asset_name: Libation.${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip |