Skip to content

启动Actions,无实际更改 #165

启动Actions,无实际更改

启动Actions,无实际更改 #165

Workflow file for this run

name: .NET
on:
push:
branches: [ "2.4" ]
pull_request:
branches: [ "2.4" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Push package
run: |
# Grab some versioning information
commithash=$(git rev-parse --short HEAD)
currtime=$(date +%s)
echo "commit hash is $commithash"
echo "time is $currtime"
# Enter project directory
cd Mirai.Net
# Build package
dotnet restore
dotnet build
# Pack a nuget package with all the default config
dotnet pack
# Enter package output directory
cd bin/Debug
# Getting file named with .nupkg extension
file=""
cdir=`ls ./*.nupkg`
for eachfile in $cdir
do
file=$eachfile
done
# Push it to source "nuget"
dotnet nuget push $file --api-key ${{ secrets.NUGET_KEY }} --source "nuget" --skip-duplicate