Skip to content

Commit

Permalink
chore: enable yarn 4 in all the workflows (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Mar 25, 2024
1 parent 61ddebe commit 2d2c44c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:

preview-frontend:
runs-on: ubuntu-latest
environment: 'Preview'
needs:
- build
steps:
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/publish-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install Yarn 4
run: |
corepack enable
yarn set version berry
- name: Install projects dependencies
uses: bahmutov/npm-install@v1
run: yarn install

- name: Publish to NPM
working-directory: packages/embed
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/sentry-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Source maps to Sentry
name: Release Sourcemaps to Sentry
on:
push:
branches:
Expand All @@ -12,16 +12,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Yarn 4
run: |
corepack enable
yarn set version berry
- name: Install projects dependencies
uses: bahmutov/npm-install@v1
run: yarn install

- name: Generate sourcemaps from build
run: yarn build:prod --filter=@snipcode/core
run: yarn build:prod --filter=...@snipcode/core

- name: Create a Sentry release
env:
Expand Down
8 changes: 5 additions & 3 deletions apps/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM node:18-buster as builder
FROM node:20-buster as builder

RUN mkdir app

WORKDIR /app

COPY . .

RUN corepack enable && yarn set version berry

RUN yarn install

RUN npx prisma generate --schema=./packages/database/prisma/schema.prisma
Expand All @@ -14,7 +16,7 @@ WORKDIR /app/apps/core

RUN yarn build:prod

FROM node:18-alpine as schema-builder
FROM node:20-alpine as schema-builder

WORKDIR /app

Expand All @@ -24,7 +26,7 @@ COPY --chown=node:node --from=builder /app/packages/database/prisma/schema.prism
RUN npx prisma generate --schema=./app/prisma/schema.prisma


FROM node:18-alpine AS snipcode
FROM node:20-alpine AS snipcode

ENV NODE_ENV=production

Expand Down

0 comments on commit 2d2c44c

Please sign in to comment.