fix #20
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
name: .NET 6 | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "dotnet6" ] | |
pull_request: | |
branches: [ "dotnet6" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest, macos-latest, windows-latest ] | |
version: [ 6.x, 7.x, 8.x ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.version }} | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore /WarnAsError | |
# test: | |
# needs: [ build ] | |
# strategy: | |
# matrix: | |
# platform: [ ubuntu-latest, macos-latest, windows-latest ] | |
# version: [ 6.x, 7.x, 8.x ] | |
# runs-on: ${{ matrix.platform }} | |
# | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Setup .NET | |
# uses: actions/setup-dotnet@v4 | |
# with: | |
# dotnet-version: ${{ matrix.version }} | |
# - name: Restore dependencies | |
# run: dotnet restore | |
# - name: Test | |
# run: dotnet test --verbosity normal | |
publish_github: | |
needs: [ build ] | |
environment: 'Production' | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'dotnet6' && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Add Nuget Source | |
run: dotnet nuget add source --store-password-in-clear-text "https://nuget.pkg.github.com/Takasaki-Studio/index.json" --username "${{ secrets.USERNAME }}" --password "${{ secrets.SECRET }}" --name "github" | |
- name: Publish to Github Package | |
run: dotnet nuget push "./Lina/bin/Release/*.nupkg" --api-key ${{ secrets.SECRET }} --source "github" | |
publish_nuget: | |
needs: [ build ] | |
environment: 'Production Nuget' | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'dotnet6' && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Publish to Github Package | |
run: dotnet nuget push "./Lina/bin/Release/*.nupkg" --api-key ${{ secrets.SECRET }} --source "nuget.org" |