Fix publish workflow (#2)
* 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>
This commit is contained in:
parent
064801380b
commit
8a82c294a1
55
.github/workflows/dotnet-publish.yml
vendored
55
.github/workflows/dotnet-publish.yml
vendored
@ -15,34 +15,57 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||||
source-url: https://nuget.pkg.github.com/<owner>/index.json
|
|
||||||
env:
|
env:
|
||||||
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore ${{ DOTNET_SLN }}
|
run: dotnet restore ${{ env.DOTNET_SLN }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ DOTNET_SLN }}
|
run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ env.DOTNET_SLN }}
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: dotnet test --configuration ${{ env.DOTNET_CONFIGURATION }} --no-build --verbosity normal ${{ DOTNET_SLN }}
|
|
||||||
|
|
||||||
- name: Zip Artifact
|
|
||||||
run: zip -r Libation.${{ github.ref_name }}.zip ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/*
|
|
||||||
|
|
||||||
- name: Publish Artifact
|
- name: Publish Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Libation ${{ github.ref_name }}
|
name: LibationZip
|
||||||
path: Libation.${{ github.ref_name }}.zip
|
path: ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/
|
||||||
if-no-files-found: error
|
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
|
||||||
Loading…
x
Reference in New Issue
Block a user