mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-03-03 14:52:16 +08:00
Switching to yarn
This commit is contained in:
parent
ed15d8809b
commit
7cb627d7ed
6
.github/workflows/check-dist.yml
vendored
6
.github/workflows/check-dist.yml
vendored
@ -24,12 +24,12 @@ jobs:
|
|||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: yarn
|
||||||
|
|
||||||
- name: Rebuild the dist/ directory
|
- name: Rebuild the dist/ directory
|
||||||
run: |
|
run: |
|
||||||
npm run build
|
yarn build
|
||||||
npm run package
|
yarn package
|
||||||
- name: Compare the expected and actual dist/ directories
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
|
|||||||
6048
package-lock.json
generated
6048
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@
|
|||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"package": "ncc build --source-map --license licenses.txt",
|
"package": "ncc build --source-map --license licenses.txt",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"all": "npm run build && npm run format && npm run lint && npm run package && npm test"
|
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import {ensureYarnIsInstalled} from './yarn'
|
|||||||
import {run} from './run'
|
import {run} from './run'
|
||||||
import {resolve} from 'path'
|
import {resolve} from 'path'
|
||||||
|
|
||||||
const main = async () => {
|
const main = async (): Promise<void> => {
|
||||||
await ensureYarnIsInstalled()
|
await ensureYarnIsInstalled()
|
||||||
|
|
||||||
const cmd: string = getInput('cmd', {required: true})
|
const cmd: string = getInput('cmd', {required: true})
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import {exec} from '@actions/exec'
|
import {exec} from '@actions/exec'
|
||||||
|
|
||||||
export const run = async (cmd: string, {cwd}: {cwd: string}) => {
|
export const run = async (cmd: string, {cwd}: {cwd: string}): Promise<void> => {
|
||||||
await exec('yarn', cmd.split(' '), {cwd})
|
await exec('yarn', cmd.split(' '), {cwd})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import {debug, setOutput} from '@actions/core'
|
|||||||
import {exec, getExecOutput} from '@actions/exec'
|
import {exec, getExecOutput} from '@actions/exec'
|
||||||
import {which} from '@actions/io'
|
import {which} from '@actions/io'
|
||||||
|
|
||||||
export const ensureYarnIsInstalled = async () => {
|
export const ensureYarnIsInstalled = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
await which('yarn', true)
|
await which('yarn', true)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user