Skip to content

Commit

Permalink
rtx -> mise
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 2, 2024
1 parent b2bd646 commit 2c307d8
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 118 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
tool_versions: ${{ matrix.tool_versions }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rtx --version
- run: rtx exec -- node --version
- run: mise --version
- run: mise exec -- node --version
- run: which node
- run: node -v
specific_version:
Expand All @@ -51,9 +51,9 @@ jobs:
- uses: ./
with:
cache_save: ${{ github.ref_name == 'main' }}
cache_key_prefix: rtx-v1
cache_key_prefix: mise-v1
version: 2023.12.23
rtx_toml: |
mise_toml: |
[tools]
bun = "1"
- run: which bun
Expand Down
File renamed without changes.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jdx/rtx-action@v1
- uses: jdx/mise-action@v1
with:
version: 2023.12.0 # [default: latest] rtx version to install
install: true # [default: true] run `rtx install`
cache: true # [default: true] cache rtx using GitHub's cache
version: 2023.12.0 # [default: latest] mise version to install
install: true # [default: true] run `mise install`
cache: true # [default: true] cache mise using GitHub's cache
# automatically write this .tool-versions file
experimental: true # [default: false] enable experimental features
tool_versions: |
shellcheck 0.9.0
# or, if you prefer .rtx.toml format:
rtx_toml: |
# or, if you prefer .mise.toml format:
mise_toml: |
[tools]
shellcheck = "0.9.0"
- run: shellcheck scripts/*.sh
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jdx/rtx-action@v1
- uses: jdx/mise-action@v1
# .tool-versions will be read from repo root
- run: node ./my_app.js
```
Alternatively, rtx is easy to use in GitHub Actions even without this:
Alternatively, mise is easy to use in GitHub Actions even without this:
```yaml
jobs:
build:
steps:
- run: |
curl https://rtx.jdx.dev/install.sh | sh
echo "$HOME/.local/share/rtx/bin" >> $GITHUB_PATH
echo "$HOME/.local/share/rtx/shims" >> $GITHUB_PATH
curl https://mise.jdx.dev/install.sh | sh
echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
```
24 changes: 12 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: rtx action
description: Actions for working with rtx runtime manager
name: mise action
description: Actions for working with mise runtime manager
author: Jeff Dickey <@jdx>
branding:
icon: arrow-down-circle
color: purple
inputs:
version:
required: false
description: The version of rtx to use. If not specified, will use the latest release.
rtx_dir:
description: The version of mise to use. If not specified, will use the latest release.
mise_dir:
required: false
description: |
The directory that rtx will be installed to, defaults to $HOME/.local/share/rtx
Or $XDG_DATA_HOME/rtx if $XDG_DATA_HOME is set.
Or $RTX_DATA_DIR if $RTX_DATA_DIR is set.
The directory that mise will be installed to, defaults to $HOME/.local/share/mise
Or $XDG_DATA_HOME/mise if $XDG_DATA_HOME is set.
Or $MISE_DATA_DIR if $MISE_DATA_DIR is set.
tool_versions:
required: false
description: If present, this value will be written to the .tool-versions file
rtx_toml:
mise_toml:
required: false
description: If present, this value will be written to the .rtx.toml file
description: If present, this value will be written to the .mise.toml file
install:
required: false
default: "true"
description: if false, will not run `rtx install`
description: if false, will not run `mise install`
install_dir:
required: false
default: "."
description: The directory that `rtx install` will be executed in
description: The directory that `mise install` will be executed in
cache:
required: false
default: "true"
Expand All @@ -38,7 +38,7 @@ inputs:
description: if false, action will not write to cache
cache_key_prefix:
required: false
default: "rtx-v0"
default: "mise-v0"
description: The prefix key to use for the cache, change this to invalidate the cache
experimental:
required: false
Expand Down
82 changes: 41 additions & 41 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "rtx-action",
"description": "rtx tool setup action",
"name": "mise-action",
"description": "mise tool setup action",
"version": "1.3.2",
"author": "jdx",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/jdx/rtx-action.git"
"url": "git+https://github.com/jdx/mise-action.git"
},
"keywords": [
"actions",
"rtx",
"mise",
"setup"
],
"exports": {
Expand Down
8 changes: 4 additions & 4 deletions src/cache-save.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import * as cache from '@actions/cache'
import * as core from '@actions/core'
import * as fs from 'fs'
import { rtxDir } from './utils'
import { miseDir } from './utils'

export async function run(): Promise<void> {
try {
await cacheRTXTools()
await cacheMiseTools()
} catch (error) {
if (error instanceof Error) core.setFailed(error.message)
else throw error
}
}

async function cacheRTXTools(): Promise<void> {
async function cacheMiseTools(): Promise<void> {
if (!core.getState('CACHE')) {
core.info('Skipping saving cache')
return
}

const state = core.getState('CACHE_KEY')
const primaryKey = core.getState('PRIMARY_KEY')
const cachePath = rtxDir()
const cachePath = miseDir()

if (!fs.existsSync(cachePath)) {
throw new Error(`Cache folder path does not exist on disk: ${cachePath}`)
Expand Down
Loading

0 comments on commit 2c307d8

Please sign in to comment.