Convert to composite action (#19)

This commit is contained in:
Ross MacArthur
2025-03-15 15:09:01 +02:00
committed by GitHub
parent 6e1de3cc40
commit e8fa8d355d
10 changed files with 17 additions and 2347 deletions
-24
View File
@@ -1,24 +0,0 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
+1 -12
View File
@@ -6,17 +6,6 @@ on:
- cron: 0 12 1 * * - cron: 0 12 1 * *
jobs: jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm ci
- run: npm run lint
- run: npm run build
test-latest: test-latest:
strategy: strategy:
matrix: matrix:
@@ -37,7 +26,7 @@ jobs:
needs: test-latest needs: test-latest
strategy: strategy:
matrix: # https://github.com/casey/just/releases matrix: # https://github.com/casey/just/releases
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, 1.23.0] 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, 1.23.0, 1.40.0]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
-112
View File
@@ -1,113 +1 @@
/runner /runner
# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# rollup.js default build output
dist/*
!dist/index.js
# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public
# Storybook build outputs
.out
.storybook-out
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# Temporary folders
tmp/
temp/
# End of https://www.gitignore.io/api/node
+9 -38
View File
@@ -21,20 +21,12 @@ If you want a specific version of `just` you can specify this by passing the
```yaml ```yaml
- uses: extractions/setup-just@v2 - uses: extractions/setup-just@v2
with: with:
just-version: '1.4.0' just-version: '1.40.0'
``` ```
To avoid rate-limiting, the default Github token available to all actions, is 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 automatically used to authenticate calls to Github. To override it, pass the
environment variable `GITHUB_TOKEN` or pass the input `github-token`. input `github-token`.
```yaml
- uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
or
```yaml ```yaml
- uses: extractions/setup-just@v2 - uses: extractions/setup-just@v2
@@ -54,38 +46,17 @@ package](https://www.npmjs.com/package/semver). This GitHub Action will install
the latest matching release. Examples include the latest matching release. Examples include
- `just-version: '*'` latest version (default). - `just-version: '*'` latest version (default).
- `just-version: '0.10'` equivalent to `>=0.10.0 <0.11.0`. - `just-version: '1'` equivalent to `>=1.0.0 <2.0.0`.
- `just-version: '0.10.x'` equivalent to `>=0.10.0 <0.11.0`. - `just-version: '1.2'` equivalent to `>=1.2.0 <2.0.0`.
- `just-version: '0.10.0'` equivalent to `=0.10.0`. - `just-version: '1.2.3'` equivalent to `=1.2.3`.
- `just-version: '^0.10.0'` equivalent to `>=0.10.0 <0.11.0`. - `just-version: '^1.2.3'` equivalent to `>=1.2.3 <2.0.0`.
## Development ## Development
Most of the installation logic is done in a shared library located at This action is a composite action and the installation logic is done in a shared
library located at
[@extractions/setup-crate](https://github.com/extractions/setup-crate). [@extractions/setup-crate](https://github.com/extractions/setup-crate).
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 ## License
Licensed under either of Licensed under either of
+7 -2
View File
@@ -12,5 +12,10 @@ inputs:
required: false required: false
default: ${{ github.token }} default: ${{ github.token }}
runs: runs:
using: 'node20' using: composite
main: 'dist/index.js' steps:
- uses: extractions/setup-crate@v1
with:
repo: casey/just
version: ${{ inputs.just-version }}
github-token: ${{ inputs.github-token }}
-9
View File
File diff suppressed because one or more lines are too long
-2021
View File
File diff suppressed because it is too large Load Diff
-36
View File
@@ -1,36 +0,0 @@
{
"name": "setup-just",
"version": "2.0.0",
"description": "Install the just command runner",
"main": "dist/index.js",
"scripts": {
"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"
},
"repository": {
"type": "git",
"url": "git+https://github.com/extractions/setup-just.git"
},
"author": "Ross MacArthur <ross@macarthur.io>",
"license": "MIT OR Apache-2.0",
"bugs": {
"url": "https://github.com/extractions/setup-just/issues"
},
"homepage": "https://github.com/extractions/setup-just#readme",
"dependencies": {
"@actions/core": "^1.10.1",
"@extractions/setup-crate": "^0.4.0"
},
"devDependencies": {
"@types/node": "^20.11.20",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
}
}
-27
View File
@@ -1,27 +0,0 @@
import * as core from "@actions/core";
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,
},
{ auth: githubToken }
);
core.addPath(tool.dir);
core.info(`Successfully setup ${tool.name} v${tool.version}`);
} catch (err) {
if (err instanceof Error) {
core.setFailed(err.message);
}
}
}
main();
-66
View File
@@ -1,66 +0,0 @@
{
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "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). */
// "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. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}