Skip to content

Commit 84cec85

Browse files
workflow updated to yarn (#1167)
1 parent aa723c6 commit 84cec85

16 files changed

Lines changed: 18946 additions & 34984 deletions

File tree

.github/actions/npm-publish/action.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Publish release to npm
22

33
inputs:
4-
node-version:
5-
required: true
64
npm-token:
75
required: true
86
version:
@@ -19,21 +17,13 @@ runs:
1917
- name: Checkout code
2018
uses: actions/checkout@v4
2119

22-
- name: Setup Node
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: ${{ inputs.node-version }}
26-
cache: 'npm'
27-
registry-url: 'https://registry.npmjs.org'
28-
29-
- name: Install dependencies
30-
shell: bash
31-
run: npm ci --include=dev
20+
- name: Setup
21+
uses: ./.github/actions/setup
3222

3323
- name: Build package
3424
if: inputs.require-build == 'true'
3525
shell: bash
36-
run: npm run build
26+
run: yarn build
3727

3828
- name: Publish release to NPM
3929
shell: bash

.github/actions/setup/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version-file: .nvmrc
11+
12+
- name: Restore dependencies
13+
id: yarn-cache
14+
uses: actions/cache/restore@v4
15+
with:
16+
path: |
17+
**/node_modules
18+
.yarn/install-state.gz
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22+
${{ runner.os }}-yarn-
23+
24+
- name: Install dependencies
25+
if: steps.yarn-cache.outputs.cache-hit != 'true'
26+
run: yarn install --immutable
27+
shell: bash
28+
29+
- name: Cache dependencies
30+
if: steps.yarn-cache.outputs.cache-hit != 'true'
31+
uses: actions/cache/save@v4
32+
with:
33+
path: |
34+
**/node_modules
35+
.yarn/install-state.gz
36+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/main.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,15 @@ jobs:
1717
name: Run JS tests
1818
runs-on: ubuntu-latest
1919

20-
env:
21-
node: 'lts/*'
22-
2320
steps:
2421
- name: Checkout
2522
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
2623

27-
- name: Setup Node.js
28-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
29-
with:
30-
node-version: ${{ env.node }}
31-
cache: 'npm'
32-
33-
- name: Install dependencies
34-
run: npm ci
24+
- name: Setup
25+
uses: ./.github/actions/setup
3526

3627
- name: Run tests
37-
run: npm run test:ci
28+
run: yarn test:ci
3829

3930
- name: Upload coverage report
4031
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d

.github/workflows/npm-release.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ name: Create npm and GitHub Release
33
on:
44
workflow_call:
55
inputs:
6-
node-version:
7-
required: true
8-
type: string
96
require-build:
10-
default: true
7+
default: 'true'
118
type: string
129
release-directory:
1310
default: './'
@@ -63,7 +60,6 @@ jobs:
6360
# Publish the release to our package manager
6461
- uses: ./.github/actions/npm-publish
6562
with:
66-
node-version: ${{ inputs.node-version }}
6763
require-build: ${{ inputs.require-build }}
6864
version: ${{ steps.get_version.outputs.version }}
6965
npm-token: ${{ secrets.npm-token }}

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ permissions:
1717
jobs:
1818
release:
1919
uses: ./.github/workflows/npm-release.yml
20-
with:
21-
node-version: 20
22-
require-build: false
2320
secrets:
2421
npm-token: ${{ secrets.NPM_TOKEN }}
2522
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ example/ios/Pods
4747
# Ruby
4848
example/vendor/
4949

50+
# Yarn
51+
.yarn/*
52+
!.yarn/patches
53+
!.yarn/plugins
54+
!.yarn/releases
55+
!.yarn/sdks
56+
!.yarn/versions
57+
5058
# node.js
5159
#
5260
node_modules/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.15.0

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)