diff --git a/.github/workflows/full-matrix.yaml b/.github/workflows/full-matrix.yaml index 71f9f2e..71fb0c3 100644 --- a/.github/workflows/full-matrix.yaml +++ b/.github/workflows/full-matrix.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-22.04, macos-latest] - ver: [0.88.1, 0.87.1, 0.86] + ver: [0.90.1, 0.88.1, 0.87.1, 0.86] runs-on: ${{ matrix.os }} name: test (${{matrix.os}}, nu@${{matrix.ver}}) diff --git a/.github/workflows/latest-matrix.yaml b/.github/workflows/latest-matrix.yaml index bd65f1a..b07a59c 100644 --- a/.github/workflows/latest-matrix.yaml +++ b/.github/workflows/latest-matrix.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-22.04, macos-latest] - ver: [0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, 0.82, '0.80', 0.79, 0.78, 0.77.1, 0.75, 0.73, 0.72, 0.71, '0.70', 0.69.1] + ver: [0.90.1, 0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, 0.82, '0.80', 0.79, 0.78, 0.77.1, 0.75, 0.73, 0.72, 0.71, '0.70'] runs-on: ${{ matrix.os }} name: test (${{matrix.os}}, nu@${{matrix.ver}}) diff --git a/.github/workflows/module-test.yaml b/.github/workflows/module-test.yaml index 068e029..04b3319 100644 --- a/.github/workflows/module-test.yaml +++ b/.github/workflows/module-test.yaml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-22.04, macos-latest, windows-latest] - ver: [0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, 0.82, '0.80', 0.79, 0.78, 0.77.1, 0.76, 0.75, 0.74, 0.73, 0.72.1, 0.71, '0.70', 0.69.1] + ver: [0.90.1, 0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, 0.82, '0.80', 0.79, 0.78, 0.77.1, 0.76, 0.75, 0.74, 0.73, 0.72.1, 0.71, '0.70'] runs-on: ${{ matrix.os }} name: test (${{matrix.os}}, nu@${{matrix.ver}}) diff --git a/.github/workflows/module-test2.yaml b/.github/workflows/module-test2.yaml index 7793d89..2537c9d 100644 --- a/.github/workflows/module-test2.yaml +++ b/.github/workflows/module-test2.yaml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-22.04, macos-latest] - ver: [0.87.1, 0.86, 0.85] + ver: [0.90.1, 0.87.1, 0.86, 0.85] runs-on: ${{ matrix.os }} name: test (${{matrix.os}}, nu@${{matrix.ver}}) diff --git a/.github/workflows/release-matrix.yaml b/.github/workflows/release-matrix.yaml index a339988..d43cd38 100644 --- a/.github/workflows/release-matrix.yaml +++ b/.github/workflows/release-matrix.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-22.04, macos-latest] - ver: [0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, '0.80', 0.79, 0.78, 0.77.1, 0.75, 0.73, 0.72, 0.71, '0.70', 0.69.1, 0.68, 0.67] + ver: [0.90.1, 0.88.1, 0.87.1, 0.86, 0.85, 0.83.1, '0.80', 0.79, 0.78, 0.77.1, 0.75, 0.73, 0.72, 0.71, '0.70', 0.69.1, 0.68] runs-on: ${{ matrix.os }} name: test (${{matrix.os}}, nu@${{matrix.ver}}) diff --git a/README.md b/README.md index 473924a..c261231 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ To use modules in `Nu`, please refer to the following examples: - name: Setup nu uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Use Your Nu Modules @@ -96,7 +96,7 @@ You have to wrap the `nu` code in `nu -c ""`, and the nu version should be equal - name: Setup nu uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Use Your Nu Modules by Absolute Path @@ -115,7 +115,7 @@ Again, the nu version should be equal to or above `0.69`. - name: Setup nu@latest uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Prepare Nu Modules @@ -200,6 +200,7 @@ If this happens you can set the `GITHUB_TOKEN` environment variable. | `check-latest` | no | Set to `true` if you want to use the latest version | bool | false | | `enable-plugins` | no | Set to `true` if you want to register the bundled plugins, Nu v0.69 and above is required | bool | false | | `features` | no | Available choice: `default` or `full`, and the `full` features will include the commands from `extra` and `dataframe`. This option support `Nu` since `v0.86` | string | `default` | +| `github-token` | no | Your GitHub token or PAT token | string | `${{ github.token }}` | The semver specification is passed directly to NPM's [semver package](https://www.npmjs.com/package/semver). This GitHub Action will install the latest matching release. diff --git a/README.zh-CN.md b/README.zh-CN.md index 97d52d1..b8ef8b1 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -74,7 +74,7 @@ jobs: - name: Setup nu uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Use Your Nu Modules @@ -91,7 +91,7 @@ jobs: - name: Setup nu uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Use Your Nu Modules by Absolute Path @@ -110,7 +110,7 @@ jobs: - name: Setup nu@latest uses: hustcer/setup-nu@v3.8 with: - version: 0.87.1 + version: 0.90.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Prepare Nu Modules @@ -191,6 +191,7 @@ jobs: | `check-latest` | 否 | 可以设置为 `true` 如果你想使用最新的 Nushell 版本 | bool | false | | `enable-plugins` | 否 | 可以设置为 `true` 如果你需要注册二进制包内的插件, 需要 Nu 版本 >= v0.69 | bool | false | | `features` | 否 | 可选项: `default`,`full`, 设置为 `full` 将包含 `extra` 和 `dataframe` 中的命令, 该选项支持 `Nu` `v0.86` 及以后版本 | string | `default` | +| `github-token` | 否 | 你的 GitHub Token 或者 PAT token | string | `${{ github.token }}` | 您在 `version` 字段指定的 **semver 版本** 会直接传递给 NPM 的 [semver 包](https://www.npmjs.com/package/semver)。此 GitHub Action 将安装最新的匹配版本。 diff --git a/action.yaml b/action.yaml index 8bc80c9..44a45c7 100644 --- a/action.yaml +++ b/action.yaml @@ -32,6 +32,10 @@ inputs: default: false required: false description: 'Enable registering of plugins' + github-token: + description: 'GitHub token or PAT token' + required: false + default: ${{ github.token }} runs: using: 'node20' diff --git a/package.json b/package.json index eda2cb4..b5a1d2f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "setup-nu", - "version": "3.8.0", - "actionVer": "v3.8", + "version": "3.9.0", + "actionVer": "v3.9", "description": "A Github Action to Setup a Nushell Environment to Run Nu Scripts or Commands", "main": "dist/index.js", "private": true, diff --git a/src/index.ts b/src/index.ts index 6259815..faf1d8d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ async function main() { const checkLatest = (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE'; const enablePlugins = (core.getInput('enable-plugins') || 'false').toUpperCase() === 'TRUE'; const features = core.getInput('features') || 'default'; + const githubToken = core.getInput('github-token'); const version = ['*', 'nightly'].includes(versionSpec) ? versionSpec : semver.valid(semver.coerce(versionSpec)); console.log(`coerce version: ${version}`); const ver = version === null ? undefined : version; @@ -23,6 +24,7 @@ async function main() { core.setFailed(`Invalid version: ${versionSpec}`); } + core.exportVariable('GITHUB_TOKEN', githubToken); const tool = await setup.checkOrInstallTool({ checkLatest, enablePlugins,