Skip to content

Commit

Permalink
task: move to yarn v4 and node20 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk authored Aug 2, 2024
1 parent da0cbb6 commit 53b6c88
Show file tree
Hide file tree
Showing 13 changed files with 8,511 additions and 5,603 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn install --immutable
env:
YARN_ENABLE_SCRIPTS: false
- run: yarn fmt:check
- run: yarn lint
- run: yarn build
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/push-docker-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: |
unleashorg/unleash-proxy
Expand All @@ -25,25 +25,25 @@ jobs:
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64,linux/amd64
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to docker hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ghcr
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm64,linux/amd64
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/push-ecr-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::726824350591:role/unleash-github-ecr-public-publish-role
role-session-name: proxy-actions-push-to-ecr-public
aws-region: us-east-1

- name: Login to AWS ECR
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
env:
AWS_DEFAULT_REGION: 'us-east-1'
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
env:
REGISTRY: ${{ steps.login-ecr-public-outputs.registry }}
REGISTRY_ALIAS: unleashorg
Expand All @@ -46,14 +46,14 @@ jobs:
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64,linux/amd64
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm64,linux/amd64
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Publish to npm
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: |
yarn install --frozen-lockfile
yarn install --immutable
- run: |
LATEST=$(npm show @unleash/proxy version)
TAG=$(node scripts/npm-tag.js $LATEST)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build changelog
id: github_release
uses: metcalfc/changelog-generator@v0.4.4
uses: metcalfc/changelog-generator@v4.3.1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ dist
.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files
Expand All @@ -104,4 +105,12 @@ dist
.tern-port

# IntelliJ
.idea
.idea

# Yarn v4
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.19
20
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.1.cjs
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
FROM node:18-alpine as builder
FROM node:20-alpine as builder

WORKDIR /unleash-proxy

COPY . .

RUN yarn install --frozen-lockfile --ignore-scripts
RUN corepack enable

ENV YARN_ENABLE_SCRIPTS=false

RUN yarn install --immutable

RUN yarn build

RUN yarn install --production --frozen-lockfile --ignore-scripts --prefer-offline
RUN yarn workspaces focus -A --production

FROM node:18-alpine
FROM node:20-alpine

# Upgrade (addresses OpenSSL CVE-2023-6237 && CVE-2024-2511)
RUN apk update && \
Expand All @@ -30,7 +34,7 @@ RUN chown -R node:node /unleash-proxy

ENTRYPOINT ["/sbin/tini", "--"]

EXPOSE 4242
EXPOSE 3000

USER node

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc --pretty",
"example": "npm run build && node example",
"example": "yarn run build && node example",
"lint": "eslint ./src",
"test": "jest",
"updateSnapshots": "jest -u",
Expand All @@ -20,7 +20,7 @@
"url": "git+https://github.com/Unleash/unleash-proxy.git"
},
"engines": {
"node": ">=16"
"node": ">=20"
},
"keywords": [
"Unleash",
Expand Down Expand Up @@ -96,5 +96,6 @@
"qs": "^6.9.7",
"json5": "^2.2.2",
"cookiejar": "^2.1.4"
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 53b6c88

Please sign in to comment.