Skip to content

Commit

Permalink
ci: make sure Yarn's global cache is disabled (#4268)
Browse files Browse the repository at this point in the history
Yarn v4 enables global caching by default, using a local cache
simplifies the use of @actions/cache.
Also simplifies the "Publish to the npm registry" step.
  • Loading branch information
aduh95 committed Jan 8, 2023
1 parent c334fb9 commit 3437074
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/bundlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ on:
- '.github/**'
- '!.github/workflows/bundlers.yml'

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
isolate_uppy:
name: Isolate Uppy package
name: Isolate Uppy packages
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
- '.github/**'
- '!.github/workflows/ci.yml'

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
unit_tests:
name: Unit tests
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/companion-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- 'packages/@uppy/companion/**'
- '.github/workflows/companion-deploy.yml'

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
npm:
name: Generate npm tarball
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- 'packages/@uppy/companion/**'
- '.github/workflows/companion.yml'

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
test:
name: Unit tests
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:

concurrency: ${{ github.workflow }}--${{ github.ref }}

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
e2e:
if: ${{ !github.event.pull_request || (contains(github.event.pull_request.labels.*.name, 'safe to test') && github.event.pull_request.state == 'open') || (github.event.pull_request.head.repo.full_name == github.repository && github.event.event_name != 'labeled') }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- '.github/**'
- '!.github/workflows/linters.yml'

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
lint_js:
name: Lint JavaScript/TypeScript
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lockile_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
paths:
- yarn.lock

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
lint_lockfile:
name: Lint yarn.lock
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/manual-cdn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
required: true
default: "uppy"

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
upload:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches: release

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
prepare-release:
name: Prepare release candidate Pull Request
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request_review:
types: [submitted]

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
release:
name: Publish releases
Expand Down Expand Up @@ -43,10 +46,10 @@ jobs:
run: corepack yarn run build
- name: Hack to allow the publish of the Angular package
run: corepack yarn workspace @uppy/angular prepublishOnly
- name: Login to NPM
run: corepack yarn config set npmAuthToken ${{ toJSON(secrets.NPM_TOKEN) }}
- name: Publish to NPM
- name: Publish to the npm registry
run: corepack yarn workspaces foreach --no-private npm publish --access public --tolerate-republish
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Merge PR
id: merge
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- '.github/workflows/website.yml'
workflow_dispatch:

env:
YARN_ENABLE_GLOBAL_CACHE: false

jobs:
deploy:
name: Deploy
Expand Down

0 comments on commit 3437074

Please sign in to comment.