From 3c60266b8a7ea4dea3d332899fb95d0acc4197dc Mon Sep 17 00:00:00 2001 From: Robin Wallin Date: Thu, 7 Nov 2024 08:43:41 +0100 Subject: [PATCH] Bump GitHub actions (#13) ### WHY / WHAT are these changes introduced? `upload-artifact@v3` is deprecated and will start with brownouts on Nov 14. We had tons of warnings from other actions, so decided to bump them all. For `upload-artifact`, there are breaking changes https://github.com/actions/upload-artifact/blob/v4.4.3/docs/MIGRATION.md, so we had to use unique names. Couldn't spot anything breaking for other bumps (doesn't mean there aren't any though) ### HOW can this pull request be tested? If CI runs well it covers most cases (from first glance, all of them). --- .github/workflows/ci.yml | 52 ++++++++++++++++++++-------------------- tar.dockerfile | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd17f29..97374c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest container: 84codes/crystal:latest-alpine steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Shards install run: shards install --production - name: Spec @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest container: 84codes/crystal:latest-alpine steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Format check run: crystal tool format --check lint: @@ -34,7 +34,7 @@ jobs: - name: Install make run: apk add --no-cache make yaml-dev - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Shards install run: shards install - name: Spec @@ -44,22 +44,22 @@ jobs: needs: [spec, format, lint] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: docker/metadata-action@v3 + - uses: actions/checkout@v4 + - uses: docker/metadata-action@v5 id: meta with: images: 84codes/sparoid tags: | type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} type=ref,event=tag - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - uses: docker/login-action@v2 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push container - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} @@ -77,10 +77,10 @@ jobs: arch: [amd64, arm64] os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, debian-10, debian-11, debian-12] steps: - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - uses: docker/build-push-action@v3 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 name: Build with: file: deb.dockerfile @@ -91,9 +91,9 @@ jobs: build_image=84codes/crystal:latest-${{ matrix.os }} outputs: builds - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: debs + name: deb-${{ matrix.arch }}-${{ matrix.os }} path: builds/ - name: Upload to PackageCloud if: ${{ startsWith(github.ref, 'refs/tags/v') }} @@ -119,10 +119,10 @@ jobs: os: [fedora-39, fedora-40] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - uses: docker/build-push-action@v3 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 with: file: rpm.dockerfile platforms: linux/${{ matrix.arch }} @@ -132,9 +132,9 @@ jobs: build_image=84codes/crystal:latest-${{ matrix.os }} outputs: builds - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: rpms + name: rpm-${{ matrix.arch }}-${{ matrix.os }} path: builds/ - name: Upload to PackageCloud if: ${{ startsWith(github.ref, 'refs/tags/v') }} @@ -154,18 +154,18 @@ jobs: runs-on: ubuntu-latest needs: [spec, format, lint] steps: - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - name: Build tar package - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: file: tar.dockerfile cache-from: type=gha cache-to: type=gha,mode=max outputs: . - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tar path: ./*.tar.gz diff --git a/tar.dockerfile b/tar.dockerfile index 2cae1be..5443013 100644 --- a/tar.dockerfile +++ b/tar.dockerfile @@ -1,4 +1,4 @@ -FROM 84codes/crystal:1.5.0-alpine-latest as build-stage +FROM 84codes/crystal:1.5.0-alpine-latest AS build-stage WORKDIR /tmp COPY shard.yml shard.lock README.md LICENSE ./ RUN shards install --production