generated from ApmeM-Archived/PluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
152 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,85 @@ | ||
name: Build | ||
name: Build and test | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v1 | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 2.2.108 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 2.2.108 | ||
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Restore packages | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build | ||
|
||
- name: Test | ||
run: dotnet test | ||
|
||
- name: Pack for version | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: dotnet pack -c Release -p:PackageVersion=${GITHUB_REF:11} | ||
|
||
- name: Setup msbuild | ||
uses: microsoft/[email protected] | ||
- name: Pack without version | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
run: dotnet pack -c Release -p:PackageVersion=1.0.0.0 | ||
|
||
- name: Setup nuget | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: 'latest' | ||
- name: Upload windows artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nuget | ||
path: ./MazeGenerators/bin/Release/MazeGenerators.*.nupkg | ||
|
||
- name: Build with dotnet | ||
run: dotnet build --configuration Release | ||
|
||
- name: Test with nunit | ||
run: dotnet test --verbosity normal | ||
pack: | ||
needs: build | ||
name: deploy | ||
runs-on: windows-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: nuget | ||
path: ./artifacts | ||
|
||
- name: Remove File | ||
run: Remove-Item –path ./MazeGenerators/obj –recurse | ||
- name: Setup nuget | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: 'latest' | ||
|
||
- name: Restore packages with nuget | ||
run: msbuild ./MazeGenerators/MazeGenerators-BridgeNet.csproj /restore /property:Configuration=Release | ||
- name: Setup nuget config | ||
run: nuget.exe sources add -name github -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build with msbuild | ||
run: msbuild ./MazeGenerators/MazeGenerators-BridgeNet.csproj /property:Configuration=Release | ||
- name: Upload to GitHub Packages | ||
run: | | ||
for f in ./artifacts/*.nupkg | ||
do | ||
nuget push $f -Source "github" | ||
done | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.