diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index 8d34cc936..4a4ec0654 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Cleanup caches run: | diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index d23bce7ad..3d305eb18 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -14,7 +14,7 @@ jobs: if: github.repository_owner == 'discordjs' steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js v24 uses: actions/setup-node@v6 diff --git a/.github/workflows/deprecate-version.yml b/.github/workflows/deprecate-version.yml index f16ef54a4..26f7efe69 100644 --- a/.github/workflows/deprecate-version.yml +++ b/.github/workflows/deprecate-version.yml @@ -36,7 +36,7 @@ jobs: if: github.repository_owner == 'discordjs' steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js v24 uses: actions/setup-node@v6 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b61f566b2..429f79483 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -38,7 +38,7 @@ jobs: if: github.repository_owner == 'discordjs' steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: ref: ${{ inputs.ref || '' }} @@ -56,7 +56,7 @@ jobs: - name: Checkout main repository if: ${{ inputs.ref && inputs.ref != 'main' }} - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: 'main' @@ -213,7 +213,7 @@ jobs: if: github.repository_owner == 'discordjs' steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js v24 uses: actions/setup-node@v6 diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml index 15ee80bac..6b3d95998 100644 --- a/.github/workflows/label-sync.yml +++ b/.github/workflows/label-sync.yml @@ -15,7 +15,7 @@ jobs: if: github.repository_owner == 'discordjs' steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Label sync uses: crazy-max/ghaction-github-labeler@v5 diff --git a/.github/workflows/publish-dev-docker.yml b/.github/workflows/publish-dev-docker.yml index 11c37e431..550b190f2 100644 --- a/.github/workflows/publish-dev-docker.yml +++ b/.github/workflows/publish-dev-docker.yml @@ -3,29 +3,88 @@ on: schedule: - cron: '0 */12 * * *' workflow_dispatch: +env: + IMAGE_NAME: discordjs/proxy jobs: - docker-publish: - name: Docker publish - runs-on: ubuntu-latest - if: github.repository_owner == 'discordjs' + build: + name: Build ${{ matrix.platform }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + - platform: linux/arm64 + runner: ubuntu-24.04-arm steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Checkout repository - uses: actions/checkout@v5 - - - name: Install Node.js v24 - uses: actions/setup-node@v6 - with: - node-version: 24 - package-manager-cache: false - - - name: Install dependencies - uses: ./packages/actions/src/pnpmCache + uses: actions/checkout@v6 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - name: Build & push docker image - run: docker build -f packages/proxy-container/Dockerfile -t discordjs/proxy:latest --push . + - name: Build and push by digest + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: packages/proxy-container/Dockerfile + platforms: ${{ matrix.platform }} + outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v5 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Create and push manifest list + runs-on: ubuntu-latest + needs: build + steps: + - name: Download digests + uses: actions/download-artifact@v6 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest \ + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 58c675a5c..c63b44b04 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -34,7 +34,7 @@ jobs: private-key: ${{ secrets.DISCORDJS_APP_KEY_RELEASE }} - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 token: ${{ steps.app-token.outputs.token }} @@ -55,7 +55,7 @@ jobs: - name: Checkout main repository (non-main ref) if: ${{ inputs.ref != 'main' }} - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: 'main' diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 5af3a4b05..5b29d28e4 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -1,28 +1,98 @@ name: Publish docker images on: workflow_dispatch: +env: + IMAGE_NAME: discordjs/proxy jobs: - docker-publish: - name: Docker publish - runs-on: ubuntu-latest + build: + name: Build ${{ matrix.platform }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + - platform: linux/arm64 + runner: ubuntu-24.04-arm steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Checkout repository - uses: actions/checkout@v5 - - - name: Install Node.js v24 - uses: actions/setup-node@v6 - with: - node-version: 24 - package-manager-cache: false - - - name: Install dependencies - uses: ./packages/actions/src/pnpmCache + uses: actions/checkout@v6 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - name: Build & push docker image - run: docker build -f packages/proxy-container/Dockerfile -t discordjs/proxy:$(cut -d '.' -f1 <<< $(jq --raw-output '.version' packages/proxy-container/package.json)) --push . + - name: Build and push by digest + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: packages/proxy-container/Dockerfile + platforms: ${{ matrix.platform }} + outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v5 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Create and push manifest list + runs-on: ubuntu-latest + needs: build + steps: + - name: Download digests + uses: actions/download-artifact@v6 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Get Major Version + id: version + run: | + FULL_VER=$(jq --raw-output '.version' packages/proxy-container/package.json) + MAJOR=$(echo $FULL_VER | cut -d '.' -f1) + echo "major=$MAJOR" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.major }} \ + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.major }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3faf8c33..092824237 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: permission-contents: write - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: token: ${{ steps.app-token.outputs.token }} ref: ${{ inputs.ref || '' }} @@ -75,7 +75,7 @@ jobs: - name: Checkout main repository if: ${{ inputs.ref && inputs.ref != 'main' }} - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: 'main' diff --git a/.github/workflows/remove-tag.yml b/.github/workflows/remove-tag.yml index 55987b88d..0cfca401d 100644 --- a/.github/workflows/remove-tag.yml +++ b/.github/workflows/remove-tag.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 67581de9f..4e2e0a904 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: TURBO_TEAM: ${{ vars.TURBO_TEAM }} steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/packages/proxy-container/Dockerfile b/packages/proxy-container/Dockerfile index effa735b9..c8974a6ee 100644 --- a/packages/proxy-container/Dockerfile +++ b/packages/proxy-container/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-alpine AS base +FROM node:24-alpine AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" @@ -12,14 +12,14 @@ RUN corepack install FROM base AS builder -RUN pnpm install --frozen-lockfile --ignore-scripts -RUN pnpm exec turbo run build --filter='@discordjs/proxy-container...' +RUN pnpm --filter='@discordjs/proxy-container...' install --frozen-lockfile --ignore-scripts +RUN pnpm exec turbo run build --filter='@discordjs/proxy-container...' --output-logs=full FROM builder AS pruned RUN pnpm --filter='@discordjs/proxy-container' --prod deploy --legacy pruned -FROM node:22-alpine AS proxy +FROM node:24-alpine AS proxy WORKDIR /usr/proxy-container diff --git a/packages/proxy-container/package.json b/packages/proxy-container/package.json index 8a88b63f6..6b37a435f 100644 --- a/packages/proxy-container/package.json +++ b/packages/proxy-container/package.json @@ -50,7 +50,7 @@ "tslib": "^2.8.1" }, "devDependencies": { - "@types/node": "^22.19.1", + "@types/node": "^24.10.1", "cross-env": "^10.1.0", "eslint": "^9.39.1", "eslint-config-neon": "^0.2.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4510865b8..4a1b63d0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1377,8 +1377,8 @@ importers: version: 2.8.1 devDependencies: '@types/node': - specifier: ^22.19.1 - version: 22.19.1 + specifier: ^24.10.1 + version: 24.10.1 cross-env: specifier: ^10.1.0 version: 10.1.0 @@ -1402,7 +1402,7 @@ importers: version: 5.44.1 tsup: specifier: ^8.5.1 - version: 8.5.1(@microsoft/api-extractor@7.55.2(@types/node@22.19.1))(jiti@2.6.1)(postcss@8.5.6)(tsx@4.19.2)(typescript@5.9.3)(yaml@2.8.2) + version: 8.5.1(@microsoft/api-extractor@7.55.2(@types/node@24.10.1))(jiti@2.6.1)(postcss@8.5.6)(tsx@4.19.2)(typescript@5.9.3)(yaml@2.8.2) turbo: specifier: ^2.6.3 version: 2.6.3