-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,3 +119,5 @@ typings/ | |
.vscode-test | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/node | ||
|
||
TODO.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,82 @@ | ||
# Setup-nu | ||
# setup-nu | ||
|
||
![build](https://img.shields.io/github/workflow/status/hustcer/setup-nu/build) | ||
|
||
This GitHub Action will setup a [Nushell](https://github.com/nushell/nushell) environment for you. | ||
|
||
## Usage | ||
|
||
### Examples | ||
|
||
In most cases you need to specify the `version` of Nushell to be used in your workflow. | ||
For example the following installs the `v0.61.0` version of [Nushell](https://github.com/nushell/nushell). | ||
Then you can set the command you want to run in the following steps, and don't forget to set `shell: nu {0}` | ||
to make the commands be execute by `nu` | ||
|
||
```yaml | ||
- uses: hustcer/setup-nu@v1-beta1 | ||
with: | ||
version: 0.61.0 | ||
- run: $'Nu version info:(char nl)'; version | ||
shell: nu {0} | ||
- name: Default shell will be `nu` | ||
shell: nu {0} | ||
run: | | ||
$'Nu path:(which nu)(char nl)' | ||
def greeting [name: string] { | ||
print $'Hello ($name)' | ||
} | ||
greeting hustcer | ||
``` | ||
Of cause, You can also set the default shell to `nu` check the following examples: | ||
|
||
1. https://github.com/hustcer/setup-nu/blob/main/.github/workflows/run-test.yaml | ||
2. https://github.com/hustcer/setup-nu/blob/main/.github/workflows/run-matrix.yaml | ||
|
||
If you want to use the latest version of nushell you can specify this by set | ||
`check-latest` to `true`. For example the following installs the latest version: | ||
|
||
```yaml | ||
- uses: hustcer/setup-nu@v1-beta1 | ||
with: | ||
check-latest: true | ||
- run: $'Nu version info:(char nl)'; version | ||
``` | ||
|
||
**Note**: Before nushell reaches 1.0, each version may change a lot, it is recommend | ||
that you use a specified version instead. | ||
|
||
In rare circumstances you might get rate limiting errors, this is because this | ||
workflow has to make requests to GitHub API in order to list available releases. | ||
If this happens you can set the `GITHUB_TOKEN` environment variable. | ||
|
||
```yaml | ||
- uses: hustcer/setup-nu@v1-beta1 | ||
with: | ||
version: 0.61.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
|
||
### Inputs | ||
|
||
| Name | Required | Description | Type | Default | | ||
| -------------- | -------- | ---------------------------------------------------- | ------ | ------- | | ||
| `version` | no | A valid NPM-style semver specification. | string | * | | ||
| `check-latest` | no | Set to `true` if you want to use the latest version | bool | | | ||
|
||
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. Examples include: | ||
|
||
- `version: '*'` latest version (default). | ||
- `version: '0.1'` equivalent to `>=0.1.0 <0.2.0`. | ||
- `version: '0.1.x'` equivalent to `>=0.1.0 <0.2.0`. | ||
- `version: '0.1.0'` equivalent to `=0.1.0`. | ||
- `version: '^0.1.0'` equivalent to `>=0.1.0 <0.2.0`. | ||
|
||
## License | ||
|
||
Licensed under: | ||
|
||
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters