10 Commits
Author SHA1 Message Date
Ross MacArthur 69d82fb023 This is 1.6.0 2023-02-12 09:16:03 +02:00
Ross MacArthur f1404cf972 Test by passing github-token instead of env 2023-02-12 09:14:10 +02:00
Ross MacArthur 82fe2e1caf Update README 2023-02-12 09:07:30 +02:00
Simon Sorensen ad659545e1 Use github token by default to authenticate download (#11) 2023-02-11 15:57:03 +02:00
Ross MacArthur 95b912dc5d This is 1.5.0 2022-09-25 21:46:03 +02:00
Ross MacArthur 8eeb0a1f9c Test latest versions and run tests once a month 2022-09-25 21:42:57 +02:00
Ross MacArthur 8843f3ad27 Upgrade dependencies 2022-09-25 21:39:40 +02:00
Ross MacArthur bd335a2937 Fix README 2021-09-13 18:39:17 +02:00
Ross MacArthur 5675d4c3ba Maintenance updates
- Add development section to README.
- Add `ncc` as a dev dependency.
- Test latest versions of `just`.
2021-08-23 22:35:16 +02:00
Ross MacArthur 7fef8ee4ca Update README and test version 0.9.0. 2021-03-31 09:25:55 +02:00
9 changed files with 1281 additions and 1297 deletions
+11 -11
View File
@@ -1,16 +1,18 @@
name: build
on: push
on:
push:
schedule:
- cron: 0 12 1 * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.x'
- run: npm install --global @zeit/ncc
node-version: '18'
- run: npm ci
- run: npm run lint
- run: npm run build
@@ -21,7 +23,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup just
uses: ./
env:
@@ -35,18 +37,16 @@ jobs:
needs: test-latest
strategy:
matrix:
just-version: [0.4.5, 0.5.11, 0.6.1, 0.7.3, 0.8.3]
just-version: [0.5.11, 0.6.1, 0.7.3, 0.8.7, 0.9.9, 0.10.7, 0.11.2, 1.5.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run self
uses: ./
with:
just-version: ${{ matrix.just-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check version
run: just --version | grep "^just v${{ matrix.just-version }}$"
run: just --version | grep -E "^just v?${{ matrix.just-version }}$"
- name: Test
run: |
[ "$(just --justfile tests/Justfile)" = "Test..." ]
+1
View File
@@ -1,3 +1,4 @@
/runner
# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node
+70 -20
View File
@@ -1,40 +1,90 @@
# `setup-just` action
# 🤖 `setup-just` action
![build](https://img.shields.io/github/workflow/status/extractions/setup-just/build)
[![Build Status](https://img.shields.io/github/actions/workflow/status/extractions/setup-just/build.yaml?branch=trunk)](https://github.com/extractions/setup-just/actions/workflows/build.yaml)
This GitHub Action will install the latest release of the
This GitHub Action will install a release of the
[just](https://github.com/casey/just) command runner for you.
## Usage
### Examples
In most cases all you will need is the following in your workflow.
```yaml
- uses: extractions/setup-just@v1
```
If you want a specific version of `just` you can specify this by passing the
`just-version` input.
```yaml
- uses: extractions/setup-just@v1
with:
just-version: '1.4.0'
```
To avoid rate-limiting, the default Github token available to all actions, is
automatically used to authenticate calls to Github. To override it, set the
environment variable `GITHUB_TOKEN` or pass the input `github-token`.
```yaml
- uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
or
```yaml
- uses: extractions/setup-just@v1
input:
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
```
### Inputs
| Name | Required | Description | Type | Default |
| -------------- | -------- | --------------------------------------- | ------ | ------- |
| `just-version` | no | A valid NPM-style semver specification. | string | * |
| Name | Required | Description | Type | Default |
| -------------- | -------- | -------------------------------------------- | ------ | --------------------- |
| `just-version` | no | A valid NPM-style semver specification. | string | * |
| `github-token` | no | A Github token to authenticate API requests. | 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. Examples include
- `just-version: '*'` latest version (default).
- `just-version: '0.8'` equivalent to `>=0.8.0 <0.9.0`.
- `just-version: '0.8.x'` equivalent to `>=0.8.0 <0.9.0`.
- `just-version: '0.8.3'` equivalent to `=0.8.3`.
- `just-version: '^0.8.3'` equivalent to `>=0.8.3 <0.9.0`.
- `just-version: '0.10'` equivalent to `>=0.10.0 <0.11.0`.
- `just-version: '0.10.x'` equivalent to `>=0.10.0 <0.11.0`.
- `just-version: '0.10.0'` equivalent to `=0.10.0`.
- `just-version: '^0.10.0'` equivalent to `>=0.10.0 <0.11.0`.
### Basic example
## Development
Add the following to your workflow.
Most of the installation logic is done in a shared library located at
[@extractions/setup-crate](https://github.com/extractions/setup-crate).
```yaml
- uses: extractions/setup-just@v1
with:
just-version: 0.8
env:
# this is not required but add it if you get any rate limiting issues
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
The following commands are useful for development.
- `npm i`
Install all dependencies.
- `npm run fmt`
Format the source code.
- `npm run lint`
Run all lints.
- `npm run run`
Test the action by running it.
- `npm run build`
Build the action and update `dist/`.
## License
+5 -1
View File
@@ -7,6 +7,10 @@ branding:
inputs:
just-version:
description: 'A valid semver specifier of the just version to install'
github-token:
description: 'Github token to use to authenticate downloads'
required: false
default: ${{ github.token }}
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
+7 -1
View File
File diff suppressed because one or more lines are too long
+1159 -1245
View File
File diff suppressed because it is too large Load Diff
+13 -12
View File
@@ -1,11 +1,11 @@
{
"name": "setup-just",
"version": "1.4.0",
"version": "1.5.0",
"description": "Install the just command runner",
"main": "dist/index.js",
"scripts": {
"fmt": "node node_modules/.bin/prettier --write **/*.ts",
"lint": "node node_modules/.bin/eslint **/*.ts",
"fmt": "prettier --write **/*.ts",
"lint": "eslint **/*.ts",
"build": "rm -rf dist/ && ncc build src/index.ts --minify",
"run": "npm run build && RUNNER_TOOL_CACHE=./runner/cache RUNNER_TEMP=./runner/temp node dist/index.js"
},
@@ -20,16 +20,17 @@
},
"homepage": "https://github.com/extractions/setup-just#readme",
"dependencies": {
"@actions/core": "^1.2.6",
"@extractions/setup-crate": "^0.2.1"
"@actions/core": "^1.9.1",
"@extractions/setup-crate": "^0.4.0"
},
"devDependencies": {
"@types/node": "^14.11.6",
"@types/semver": "^7.3.4",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.10.0",
"prettier": "^2.1.2",
"typescript": "^4.0.3"
"@types/node": "^18.7.21",
"@types/semver": "^7.3.12",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.24.0",
"prettier": "^2.7.1",
"typescript": "^4.8.3"
}
}
+14 -6
View File
@@ -3,16 +3,24 @@ import * as setup from "@extractions/setup-crate";
async function main() {
try {
const githubToken =
process.env.GITHUB_TOKEN || core.getInput("github-token");
const versionSpec = core.getInput("just-version");
const tool = await setup.checkOrInstallTool({
owner: "casey",
name: "just",
versionSpec,
});
const tool = await setup.checkOrInstallTool(
{
owner: "casey",
name: "just",
versionSpec,
},
{ auth: githubToken }
);
core.addPath(tool.dir);
core.info(`Successfully setup ${tool.name} v${tool.version}`);
} catch (err) {
core.setFailed(err.message);
if (err instanceof Error) {
core.setFailed(err.message);
}
}
}
+1 -1
View File
@@ -39,7 +39,7 @@
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */