Skip to content

Commit

Permalink
chore: fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Jul 17, 2023
1 parent 9b7b781 commit 9365824
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Deprecate versions
run: yarn npm-deprecate
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Run ESLint
run: yarn lint --fix=false
run: yarn lint -- --fix=false

# Testing:
# name: Unit Tests
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Build Code
run: yarn build

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs-on-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Build all packages
run: yarn build
- name: Generate Docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deprecate-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
uses: ./scripts/yarnCache
- name: Deprecate versions
run: yarn npm-deprecate --name "*pr-${PR_NUMBER}*" -d -v
env:
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@commitlint/config-conventional": "^17.6.6",
"@favware/cliff-jumper": "^2.1.1",
"@favware/npm-deprecate": "^1.0.7",
"@types/is-ci": "^3.0.0",
"@types/node": "^20.4.2",
"@vitest/coverage-v8": "^0.33.0",
"cz-conventional-changelog": "^3.3.0",
Expand All @@ -30,7 +29,6 @@
"eslint-config-mahir": "^0.0.29",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"pinst": "^3.0.0",
"prettier": "^3.0.0",
"tsup": "^7.1.0",
"turbo": "^1.10.7",
Expand Down
6 changes: 5 additions & 1 deletion packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';

import { createTsupConfig } from '../../tsup.config.js';
import { createTsupConfig } from '../../scripts/tsup.config.js';

export default createTsupConfig({
dts: {
entry: 'src/index.ts'
},
entry: ['src/index.ts', 'src/cli.ts'],
esbuildPlugins: [esbuildPluginVersionInjector()]
});
2 changes: 1 addition & 1 deletion packages/core/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createVitestConfig } from '../../vitest.config.js';
import { createVitestConfig } from '../../scripts/vitest.config.js';

export default createVitestConfig();
6 changes: 2 additions & 4 deletions tsup.config.ts → scripts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { defineConfig, type Options } from 'tsup';
export const createTsupConfig = (options: Options = {}) =>
defineConfig({
clean: true,
dts: {
entry: 'src/index.ts'
},
entry: ['src/index.ts', 'src/cli.ts'],
dts: true,
entry: ['src/index.ts'],
format: ['esm'],
minify: false,
skipNodeModulesBundle: true,
Expand Down
File renamed without changes.
35 changes: 35 additions & 0 deletions scripts/yarnCache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'yarn install'
description: 'Run yarn install with node_modules linker and cache enabled'
runs:
using: 'composite'
steps:
- name: Expose yarn config as "$GITHUB_OUTPUT"
id: yarn-config
shell: bash
run: |
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Restore yarn cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-download-cache-
- name: Restore yarn install state
id: yarn-install-state-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: .yarn/ci-cache/
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}

- name: Install dependencies
shell: bash
run: |
yarn install --immutable --inline-builds
env:
YARN_ENABLE_GLOBAL_CACHE: 'false'
YARN_NM_MODE: 'hardlinks-local'
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
22 changes: 1 addition & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -971,15 +971,6 @@ __metadata:
languageName: node
linkType: hard

"@types/is-ci@npm:^3.0.0":
version: 3.0.0
resolution: "@types/is-ci@npm:3.0.0"
dependencies:
ci-info: ^3.1.0
checksum: 7c1f1f16c1fa2134de7400d82766c83fa76057261ba890628af77a09382ebb92d945bb077b98cfcf3d40ab1469c9ffbd2278112867edbe57aa655f53547eb139
languageName: node
linkType: hard

"@types/istanbul-lib-coverage@npm:^2.0.1":
version: 2.0.4
resolution: "@types/istanbul-lib-coverage@npm:2.0.4"
Expand Down Expand Up @@ -1883,7 +1874,7 @@ __metadata:
languageName: node
linkType: hard

"ci-info@npm:^3.1.0, ci-info@npm:^3.8.0":
"ci-info@npm:^3.8.0":
version: 3.8.0
resolution: "ci-info@npm:3.8.0"
checksum: d0a4d3160497cae54294974a7246202244fff031b0a6ea20dd57b10ec510aa17399c41a1b0982142c105f3255aff2173e5c0dd7302ee1b2f28ba3debda375098
Expand Down Expand Up @@ -5661,15 +5652,6 @@ __metadata:
languageName: node
linkType: hard

"pinst@npm:^3.0.0":
version: 3.0.0
resolution: "pinst@npm:3.0.0"
bin:
pinst: bin.js
checksum: 4ae48a6a60f79c37071233af51b4d91bfc85cfa3c12b66ccda60cdb642b4d14a4ab0cb3587afc55b1f6192cea1772a5e4822026a0d0d3528296edef00cc2d61f
languageName: node
linkType: hard

"pirates@npm:^4.0.1":
version: 4.0.5
resolution: "pirates@npm:4.0.5"
Expand Down Expand Up @@ -6095,7 +6077,6 @@ __metadata:
"@commitlint/config-conventional": ^17.6.6
"@favware/cliff-jumper": ^2.1.1
"@favware/npm-deprecate": ^1.0.7
"@types/is-ci": ^3.0.0
"@types/node": ^20.4.2
"@vitest/coverage-v8": ^0.33.0
cz-conventional-changelog: ^3.3.0
Expand All @@ -6104,7 +6085,6 @@ __metadata:
eslint-config-mahir: ^0.0.29
husky: ^8.0.3
lint-staged: ^13.2.3
pinst: ^3.0.0
prettier: ^3.0.0
tsup: ^7.1.0
turbo: ^1.10.7
Expand Down

0 comments on commit 9365824

Please sign in to comment.