build: update build script

This commit is contained in:
cxfksword 2023-11-24 23:21:33 +08:00
parent d0f8f1e579
commit ea4788f894
4 changed files with 12 additions and 5 deletions

View File

@ -11,7 +11,7 @@ env:
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
name: Build & Release name: Build & Release
steps: steps:
@ -20,8 +20,12 @@ jobs:
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup dotnet - name: Setup dotnet
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
id: dotnet
with: with:
dotnet-version: ${{ env.dotnet-version }} dotnet-version: ${{ env.dotnet-version }}
- name: Change default dotnet version
run: |
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: Initialize workflow variables - name: Initialize workflow variables
id: vars id: vars
run: | run: |

View File

@ -15,11 +15,9 @@ jobs:
id: dotnet id: dotnet
with: with:
dotnet-version: 6.0.x dotnet-version: 6.0.x
- name: force dotnet version - name: Change default dotnet version
run: | run: |
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: print
run: dotnet --list-sdks && dotnet --info
- name: Install dependencies - name: Install dependencies
run: dotnet restore run: dotnet restore
- name: Build - name: Build

View File

@ -12,7 +12,7 @@ env:
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
name: Build & Release name: Build & Release
steps: steps:
@ -21,8 +21,12 @@ jobs:
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup dotnet - name: Setup dotnet
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
id: dotnet
with: with:
dotnet-version: ${{ env.dotnet-version }} dotnet-version: ${{ env.dotnet-version }}
- name: Change default dotnet version
run: |
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: Setup python - name: Setup python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:

1
global.json Normal file
View File

@ -0,0 +1 @@
{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}