修改说明,node支持版本号别名

This commit is contained in:
空巷一人 2024-03-09 21:38:53 +08:00
parent 8d3c8e0696
commit 8b7b8854b5

View File

@ -2,10 +2,12 @@
## 注意 ## 注意
1、需要指定具体版本号 1、go 和 dotnet 需要指定具体版本号
2、因为我没有 mac,所以没有 mac 环境 2、因为我没有 mac,所以没有 mac 环境
3、如果你想让 go 和 dotnet 支持版本号别名,欢迎 [pr](https://github.com/kongxiangyiren/version-alias)
## Usage ## Usage
See [action.yml](action.yml) See [action.yml](action.yml)
@ -13,11 +15,13 @@ See [action.yml](action.yml)
<!-- start usage --> <!-- start usage -->
```yaml ```yaml
- uses: kongxiangyiren/gitea-tool-cache@v1 - id: tool-cache
uses: kongxiangyiren/gitea-tool-cache@v2
with: with:
# 需要指定具体版本号 # go 和 dotnet 需要指定具体版本号
node-version: 18.18.0 node-version: 18
go-version: 1.21.1 go-version: 1.21.1
dotnet-version: 6.0.100
``` ```
<!-- end usage --> <!-- end usage -->
@ -30,8 +34,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
# 使用gitea-tool-cache需要指定具体的版本号 # go 和 dotnet 需要指定具体版本号
node: ['18.18.0'] node: [18]
go: ['1.21.1'] go: ['1.21.1']
dotnet: ['6.0.100'] dotnet: ['6.0.100']
@ -39,15 +43,16 @@ jobs:
- name: Checkout - name: Checkout
uses: https://gitea.cn/actions/checkout@v4 uses: https://gitea.cn/actions/checkout@v4
- id: tool-cache - id: tool-cache
uses: kongxiangyiren/gitea-tool-cache@v1 uses: kongxiangyiren/gitea-tool-cache@v2
with: with:
# 需要指定具体版本号 # go 和 dotnet 需要指定具体版本号
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
dotnet-version: ${{ matrix.dotnet }} dotnet-version: ${{ matrix.dotnet }}
- uses: https://gitea.cn/actions/setup-node@v4 - uses: https://gitea.cn/actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} # gitea-tool-cache导出 node 具体版本
node-version: ${{ steps.tool-cache.outputs.node-version }}
- run: node -v - run: node -v
- uses: https://gitea.cn/actions/setup-go@v2 - uses: https://gitea.cn/actions/setup-go@v2
with: with:
@ -71,20 +76,21 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
# 使用gitea-tool-cache需要指定具体的版本号 # 只有node支持版本号别名
node: ['18.18.0'] node: ['18']
steps: steps:
- name: Checkout - name: Checkout
uses: https://gitea.cn/actions/checkout@v4 uses: https://gitea.cn/actions/checkout@v4
- name: 安装环境 - id: tool-cache
uses: kongxiangyiren/gitea-tool-cache@v1 uses: kongxiangyiren/gitea-tool-cache@v2
with: with:
# 需要指定具体版本号 # 只有node支持版本号别名
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- uses: https://gitea.cn/actions/setup-node@v4 - uses: https://gitea.cn/actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} # gitea-tool-cache导出 node 具体版本
node-version: ${{ steps.tool-cache.outputs.node-version }}
- run: node -v - run: node -v
``` ```
@ -103,7 +109,7 @@ jobs:
- name: Checkout - name: Checkout
uses: https://gitea.cn/actions/checkout@v4 uses: https://gitea.cn/actions/checkout@v4
- name: 安装环境 - name: 安装环境
uses: kongxiangyiren/gitea-tool-cache@v1 uses: kongxiangyiren/gitea-tool-cache@v2
with: with:
# 需要指定具体版本号 # 需要指定具体版本号
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
@ -128,7 +134,7 @@ jobs:
- name: Checkout - name: Checkout
uses: https://gitea.cn/actions/checkout@v4 uses: https://gitea.cn/actions/checkout@v4
- id: tool-cache - id: tool-cache
uses: kongxiangyiren/gitea-tool-cache@v1 uses: kongxiangyiren/gitea-tool-cache@v2
with: with:
# 需要指定具体版本号 # 需要指定具体版本号
dotnet-version: ${{ matrix.dotnet }} dotnet-version: ${{ matrix.dotnet }}