From 0b79ba8ac97a57d7358a04399e588d11e34c2e36 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 26 Jun 2024 18:38:47 +0200 Subject: [PATCH] chore: update actions --- .github/workflows/build.yml | 14 +++--- .github/workflows/image.yml | 92 +++++++++++++++++------------------ .github/workflows/lint.yml | 6 +-- .github/workflows/release.yml | 2 +- README.md | 4 +- 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6005f0f..e03e411b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,11 @@ jobs: node: ['20'] name: Node ${{ matrix.node }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '${{ matrix.node }}' - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache with: path: node_modules @@ -34,11 +34,11 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: package.json - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache with: path: node_modules @@ -53,7 +53,7 @@ jobs: - name: Docs run: cd docs && zip -r ../gh-pages _site/ - name: Archive Artifacts - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: ${{ github.sha }} path: | diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 9d4bf418..5f1a6f51 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -9,54 +9,54 @@ jobs: image: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: builder-image - run: | - set -euxo pipefail + - uses: actions/checkout@v4 + - name: builder-image + run: | + set -euxo pipefail - img=ghcr.io/getsentry/craft-builder:latest - args=() - if docker pull -q "$img"; then - args+=(--cache-from "$img") - fi - docker buildx build \ - "${args[@]}" \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --target builder \ - --tag "$img" \ - . - - name: image - run: | - set -euxo pipefail + img=ghcr.io/getsentry/craft-builder:latest + args=() + if docker pull -q "$img"; then + args+=(--cache-from "$img") + fi + docker buildx build \ + "${args[@]}" \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --target builder \ + --tag "$img" \ + . + - name: image + run: | + set -euxo pipefail - img=ghcr.io/getsentry/craft:latest - args=() - if docker pull -q "$img"; then - args+=(--cache-from "$img") - fi - docker buildx build \ - "${args[@]}" \ - --build-arg "SOURCE_COMMIT=$GITHUB_SHA" \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --tag "$img" \ - . - - name: docker login - run: docker login --username "$DOCKER_USER" --password-stdin ghcr.io <<< "$DOCKER_PASS" - env: - DOCKER_USER: ${{ github.actor }} - DOCKER_PASS: ${{ secrets.GITHUB_TOKEN }} - if: github.event_name != 'pull_request' - - name: docker push - run: | - set -euxo pipefail + img=ghcr.io/getsentry/craft:latest + args=() + if docker pull -q "$img"; then + args+=(--cache-from "$img") + fi + docker buildx build \ + "${args[@]}" \ + --build-arg "SOURCE_COMMIT=$GITHUB_SHA" \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --tag "$img" \ + . + - name: docker login + run: docker login --username "$DOCKER_USER" --password-stdin ghcr.io <<< "$DOCKER_PASS" + env: + DOCKER_USER: ${{ github.actor }} + DOCKER_PASS: ${{ secrets.GITHUB_TOKEN }} + if: github.event_name != 'pull_request' + - name: docker push + run: | + set -euxo pipefail - craft_builder=ghcr.io/getsentry/craft-builder:latest - craft_latest=ghcr.io/getsentry/craft:latest - craft_versioned="ghcr.io/getsentry/craft:${GITHUB_SHA}" + craft_builder=ghcr.io/getsentry/craft-builder:latest + craft_latest=ghcr.io/getsentry/craft:latest + craft_versioned="ghcr.io/getsentry/craft:${GITHUB_SHA}" - docker push "$craft_builder" + docker push "$craft_builder" - docker tag "$craft_latest" "$craft_versioned" - docker push "$craft_versioned" - docker push "$craft_latest" - if: github.event_name != 'pull_request' + docker tag "$craft_latest" "$craft_versioned" + docker push "$craft_versioned" + docker push "$craft_latest" + if: github.event_name != 'pull_request' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 07b4416b..709c66b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,13 +8,13 @@ jobs: name: Lint fixes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version-file: package.json - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache with: path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c520eec..801250c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest name: 'Release a new version' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all commits so we can determine previous version fetch-depth: 0 diff --git a/README.md b/README.md index 795ddab7..2b40c5b7 100644 --- a/README.md +++ b/README.md @@ -1274,12 +1274,12 @@ Here is how you can integrate your GitHub project with `craft`: - 'release/**' ``` -2. Use the official `actions/upload-artifact@v2` action to upload your assets. +2. Use the official `actions/upload-artifact` action to upload your assets. Here is an example config (step) of an archive job: ```yaml - name: Archive Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ github.sha }} path: |