Skip to content

Commit

Permalink
Bump version v1-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Apr 29, 2022
1 parent 49b7ee5 commit 0f813f3
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ typings/
.vscode-test

# End of https://www.toptal.com/developers/gitignore/api/node

TODO.md
83 changes: 82 additions & 1 deletion README.md
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)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-nu",
"version": "0.1.0",
"version": "1.0.0",
"description": "Install nushell",
"main": "dist/index.js",
"private": true,
Expand Down

0 comments on commit 0f813f3

Please # to comment.