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:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
name: Build & Release
steps:
@ -20,8 +20,12 @@ jobs:
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup dotnet
uses: actions/setup-dotnet@v3
id: dotnet
with:
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
id: vars
run: |

View File

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

View File

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

1
global.json Normal file
View File

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