From fcc8d8881aa338c5011f1173ad2d16efa13591c3 Mon Sep 17 00:00:00 2001 From: MarcoCoreDuo <90222533+MarcoCoreDuo@users.noreply.github.com> Date: Thu, 18 Jul 2024 06:32:16 +0200 Subject: Switch to Distube's ytdl-core fork (resolves playback issue) (#1042) --- .github/workflows/lint.yml | 2 +- .github/workflows/type-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1ce6166..fffe189 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '18' cache: 'yarn' - name: Install dependencies run: yarn install diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index b4c765a..ac61d5b 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '18' cache: 'yarn' - name: Install dependencies run: yarn install -- cgit v1.2.3 From e494287d1d4e220c98856ac1c5c3a34231debe7f Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 20:22:57 -0700 Subject: Update Docker builds to publish to ghcr.io & update README (#1067) --- .github/workflows/pr-release.yml | 78 +++++++++++++++++++++++++++++++++ .github/workflows/pr-snapshot.yml | 86 ++++++++++++++++++++++++++++++++++++ .github/workflows/pr.yml | 91 --------------------------------------- .github/workflows/publish.yml | 68 ++++++++++++++++++----------- 4 files changed, 207 insertions(+), 116 deletions(-) create mode 100644 .github/workflows/pr-release.yml create mode 100644 .github/workflows/pr-snapshot.yml delete mode 100644 .github/workflows/pr.yml (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml new file mode 100644 index 0000000..4665802 --- /dev/null +++ b/.github/workflows/pr-release.yml @@ -0,0 +1,78 @@ +name: Release snapshot of PR +on: + workflow_run: + workflows: ["Build snapshot of PR"] + types: + - completed + +jobs: + release-and-comment: + name: Release snapshot and comment in PR + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Download images + uses: actions/download-artifact@v4 + with: + path: /tmp/images + pattern: image-* + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.WORKFLOW_PAT }} + + - name: Load image + run: | + docker load --input /tmp/images/image-amd64.tar + docker load --input /tmp/images/image-arm64.tar + + - name: Download PR number + uses: actions/download-artifact@v4 + with: + path: /tmp/pull_request_number + pattern: pull_request_number + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.WORKFLOW_PAT }} + + - name: Read the pull_request_number.txt file + id: pull_request_number_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: ./pull_request_number/pull_request_number.txt + + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push + working-directory: /tmp/digests + run: docker buildx imagetools create -t 'ghcr.io/museofficial/muse:pr-${{ github.event.number }}' -t 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-amd64' + + - name: Create comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: "pr-release" + number: ${{ steps.pull_request_number_reader.outputs.content }} + message: | + #### :package: A new release has been made for this pull request. + + To play around with this PR, pull `ghcr.io/museofficial/muse:pr-${{ github.event.number }}` or `ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}`. + + Images are available for x86_64 and ARM64. + + > Latest commit: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/pr-snapshot.yml b/.github/workflows/pr-snapshot.yml new file mode 100644 index 0000000..882a5ad --- /dev/null +++ b/.github/workflows/pr-snapshot.yml @@ -0,0 +1,86 @@ +name: Build snapshot of PR + +on: pull_request + +env: + REGISTRY_IMAGE: ghcr.io/museofficial/muse + +jobs: + build: + name: Build snapshot + strategy: + matrix: + runner-platform: + - ubuntu-latest + - namespace-profile-default-arm64 + include: + - runner-platform: ubuntu-latest + build-arch: linux/amd64 + tagged-platform: amd64 + - runner-platform: namespace-profile-default-arm64 + build-arch: linux/arm64 + tagged-platform: arm64 + runs-on: ${{ matrix.runner-platform }} + steps: + - name: Prepare + run: | + platform=${{ matrix.build-arch }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + tags: type=ref,event=pr + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get current time + uses: josStorer/get-current-time@v2 + id: current-time + + - name: Build + id: build + uses: docker/build-push-action@v6 + with: + outputs: type=docker,dest=/tmp/image.tar + tags: ${{ steps.meta.outputs.tags }} + platforms: ${{ matrix.build-arch }} + build-args: | + COMMIT_HASH=${{ github.sha }} + BUILD_DATE=${{ steps.current-time.outputs.time }} + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload image + uses: actions/upload-artifact@v4 + with: + name: image-${{ env.PLATFORM_PAIR }} + path: /tmp/image.tar + if-no-files-found: error + retention-days: 1 + + - name: Save PR number in artifact + shell: bash + env: + PR_NUMBER: ${{ github.event.number }} + run: echo $PR_NUMBER > /tmp/pull_request_number.txt + - name: Upload PR number + uses: actions/upload-artifact@v4 + with: + name: pull_request_number + path: /tmp/pull_request_number.txt + overwrite: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 7c611ac..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: PR Workflow - -on: pull_request_target - -jobs: - release-snapshot: - name: Release snapshot - strategy: - matrix: - runner-platform: - - ubuntu-latest - - buildjet-4vcpu-ubuntu-2204-arm - include: - - runner-platform: ubuntu-latest - build-arch: linux/amd64 - tagged-platform: amd64 - - runner-platform: buildjet-4vcpu-ubuntu-2204-arm - build-arch: linux/arm64 - tagged-platform: arm64 - runs-on: ${{ matrix.runner-platform }} - steps: - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - # AWS data transfer is pricy - if: ${{ matrix.runner-platform != 'buildjet-4vcpu-ubuntu-2204-arm' }} - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }}-${{ github.event.pull_request.head.sha }} - restore-keys: | - ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }} - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Get current time - uses: josStorer/get-current-time@v2 - id: current-time - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: codetheweb/muse:${{ github.event.pull_request.head.sha }}-${{ matrix.tagged-platform }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=min - platforms: ${{ matrix.build-arch }} - build-args: | - COMMIT_HASH=${{ github.sha }} - BUILD_DATE=${{ steps.current-time.outputs.time }} - - combine-and-comment: - name: Combine platform tags and leave comment - runs-on: ubuntu-latest - needs: release-snapshot - steps: - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Combine tags - run: docker buildx imagetools create -t 'codetheweb/muse:pr-${{ github.event.number }}' -t 'codetheweb/muse:${{ github.event.pull_request.head.sha }}' 'codetheweb/muse:${{ github.event.pull_request.head.sha }}-arm64' 'codetheweb/muse:${{ github.event.pull_request.head.sha }}-amd64' - - - name: Create comment - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: "pr-release" - message: | - #### :package: A new release has been made for this pull request. - - To play around with this PR, pull `codetheweb/muse:pr-${{ github.event.number }}` or `codetheweb/muse:${{ github.event.pull_request.head.sha }}`. - - Images are available for x86_64 and ARM64. - - > Latest commit: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 08acff9..7e7a4f6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,28 +11,23 @@ jobs: matrix: runner-platform: - ubuntu-latest - - buildjet-4vcpu-ubuntu-2204-arm + - namespace-profile-default-arm64 include: - runner-platform: ubuntu-latest build-arch: linux/amd64 tagged-platform: amd64 - - runner-platform: buildjet-4vcpu-ubuntu-2204-arm + - runner-platform: namespace-profile-default-arm64 build-arch: linux/arm64 tagged-platform: arm64 runs-on: ${{ matrix.runner-platform }} + permissions: + contents: read + packages: write + attestations: write + id-token: write steps: - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - # AWS data transfer is pricy - if: ${{ matrix.runner-platform != 'buildjet-4vcpu-ubuntu-2204-arm' }} - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }} + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v1 @@ -40,19 +35,26 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Get current time uses: josStorer/get-current-time@v2 id: current-time - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: push: true - tags: codetheweb/muse:${{ github.sha }}-${{ matrix.tagged-platform }} + tags: | + codetheweb/muse:${{ github.sha }}-${{ matrix.tagged-platform }} + ghcr.io/museofficial/muse:${{ github.sha }}-${{ matrix.tagged-platform }} platforms: ${{ matrix.build-arch }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=min build-args: | COMMIT_HASH=${{ github.sha }} BUILD_DATE=${{ steps.current-time.outputs.time }} @@ -73,21 +75,37 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tags - id: get-tags + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get tags (Docker Hub) + id: get-tags-dockerhub uses: Surgo/docker-smart-tag-action@v1 with: docker_image: codetheweb/muse - - name: Combine tags - run: docker buildx imagetools create $(echo '${{ steps.get-tags.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/muse:${{ github.sha }}-arm64' 'codetheweb/muse:${{ github.sha }}-amd64' + - name: Get tags (ghcr.io) + id: get-tags-ghcr + uses: Surgo/docker-smart-tag-action@v1 + with: + docker_image: codetheweb/muse + + - name: Combine tags (Docker Hub) + run: docker buildx imagetools create $(echo '${{ steps.get-tags-dockerhub.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/muse:${{ github.sha }}-arm64' 'codetheweb/muse:${{ github.sha }}-amd64' + + - name: Combine tags (GitHub Container Registry) + run: docker buildx imagetools create $(echo '${{ steps.get-tags-ghcr.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'ghcr.io/museofficial/muse:${{ github.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.sha }}-amd64' - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v2.4.3 - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - DOCKERHUB_REPOSITORY: codetheweb/muse + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: codetheweb/muse release: name: Create GitHub release -- cgit v1.2.3 From 6d6fc4c09dfb42149805332ef4d0302bb9ffa253 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 20:42:08 -0700 Subject: Update PR release workflow --- .github/workflows/pr-release.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 4665802..35e12aa 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -19,15 +19,18 @@ jobs: uses: actions/download-artifact@v4 with: path: /tmp/images - pattern: image-* + pattern: image-linux-* merge-multiple: true run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.WORKFLOW_PAT }} + github-token: ${{ secrets.GH_PAT }} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 - name: Load image run: | - docker load --input /tmp/images/image-amd64.tar - docker load --input /tmp/images/image-arm64.tar + docker load --input /tmp/images/image-linux-amd64.tar + docker load --input /tmp/images/image-linux-arm64.tar - name: Download PR number uses: actions/download-artifact@v4 @@ -35,7 +38,7 @@ jobs: path: /tmp/pull_request_number pattern: pull_request_number run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.WORKFLOW_PAT }} + github-token: ${{ secrets.GH_PAT }} - name: Read the pull_request_number.txt file id: pull_request_number_reader @@ -43,15 +46,6 @@ jobs: with: path: ./pull_request_number/pull_request_number.txt - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -59,9 +53,18 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Push + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Create manifest list and push working-directory: /tmp/digests - run: docker buildx imagetools create -t 'ghcr.io/museofficial/muse:pr-${{ github.event.number }}' -t 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-amd64' + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 @@ -69,7 +72,7 @@ jobs: header: "pr-release" number: ${{ steps.pull_request_number_reader.outputs.content }} message: | - #### :package: A new release has been made for this pull request. + #### :package: :robot: A new release has been made for this pull request. To play around with this PR, pull `ghcr.io/museofficial/muse:pr-${{ github.event.number }}` or `ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}`. -- cgit v1.2.3 From 7f72a74ff808516c6269bf87c80facba14820901 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 20:49:48 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 35e12aa..b0a74fc 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -44,7 +44,7 @@ jobs: id: pull_request_number_reader uses: juliangruber/read-file-action@v1.0.0 with: - path: ./pull_request_number/pull_request_number.txt + path: /tmp/pull_request_number/pull_request_number - name: Login to GitHub Container Registry uses: docker/login-action@v3 -- cgit v1.2.3 From 76236005c6ce636e257e9dc862131e72b11f9f56 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 20:54:02 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index b0a74fc..91699e2 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -44,7 +44,7 @@ jobs: id: pull_request_number_reader uses: juliangruber/read-file-action@v1.0.0 with: - path: /tmp/pull_request_number/pull_request_number + path: /tmp/pull_request_number/pull_request_number/pull_request_number.txt - name: Login to GitHub Container Registry uses: docker/login-action@v3 -- cgit v1.2.3 From 22be075c8161441b8a7249e3f97e00054f79c1e9 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 20:59:09 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 91699e2..8a12083 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -59,6 +59,8 @@ jobs: path: /tmp/digests pattern: digests-* merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GH_PAT }} - name: Create manifest list and push working-directory: /tmp/digests -- cgit v1.2.3 From 20e589f3bd20b8d1131b3c57a871c74651457dff Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:05:17 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 8a12083..d2f38fd 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -5,6 +5,9 @@ on: types: - completed +env: + REGISTRY_IMAGE: ghcr.io/museofficial/muse + jobs: release-and-comment: name: Release snapshot and comment in PR @@ -76,7 +79,7 @@ jobs: message: | #### :package: :robot: A new release has been made for this pull request. - To play around with this PR, pull `ghcr.io/museofficial/muse:pr-${{ github.event.number }}` or `ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}`. + To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ github.event.number }}` or `${{ env.REGISTRY_IMAGE }}:${{ github.event.pull_request.head.sha }}`. Images are available for x86_64 and ARM64. -- cgit v1.2.3 From aa4612a45fc62369ce3c285ca765f0ddfb17a6d6 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:08:03 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index d2f38fd..6bd011f 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -35,6 +35,20 @@ jobs: docker load --input /tmp/images/image-linux-amd64.tar docker load --input /tmp/images/image-linux-arm64.tar + - name: Download Docker metadata + uses: actions/download-artifact@v4 + with: + path: /tmp/metadata + pattern: metadata + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GH_PAT }} + + - name: Read the metadata.json file + id: metadata_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: /tmp/metadata/metadata/metadata.json + - name: Download PR number uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From 2d8f66f8a1e950412462c55f7803cb4aab3f4ed3 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:16:35 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 6bd011f..38b66da 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -82,7 +82,7 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< echo '${{ steps.metadata_reader.outputs.content }}') \ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - name: Create comment -- cgit v1.2.3 From 7e2d79f3fb7febbb5368cd14eef55274b505c66d Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:22:51 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 38b66da..6b4de17 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -82,7 +82,7 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< echo '${{ steps.metadata_reader.outputs.content }}') \ + docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - name: Create comment -- cgit v1.2.3 From 72667bf00eb53045a7bf4479e697246081b8294c Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:35:25 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 6b4de17..b6fe760 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -83,7 +83,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + $(printf '${{ env.REGISTRY_IMAGE }}:%s ' *) - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 -- cgit v1.2.3 From fbe64036d8a60bcf6854ba988ec6bdf81e1db863 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:50:19 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index b6fe760..7f93d59 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -32,8 +32,8 @@ jobs: - name: Load image run: | - docker load --input /tmp/images/image-linux-amd64.tar - docker load --input /tmp/images/image-linux-arm64.tar + docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar + docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar - name: Download Docker metadata uses: actions/download-artifact@v4 -- cgit v1.2.3 From c8fd5cf97e308085e8a32dbcee6427154ad1e0fd Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 21:59:43 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 7f93d59..87fec1e 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -31,6 +31,8 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Load image + shell: bash + id: load-image run: | docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar @@ -83,7 +85,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(printf '${{ env.REGISTRY_IMAGE }}:%s ' *) + $(echo ${{ steps.load-image.outputs }} | sed 's/sha256://g' | tr '\n' ' ') - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 -- cgit v1.2.3 From fdbd3cd527abab1571e9ea78926ad0e3bfbe3df0 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:06:01 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 87fec1e..454a023 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -34,8 +34,8 @@ jobs: shell: bash id: load-image run: | - docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar - docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar + echo "AMD64_IMAGE_SHA=$(docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar)" >> $GITHUB_ENV" + echo "ARM64_IMAGE_SHA=$(docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar)" >> $GITHUB_ENV" - name: Download Docker metadata uses: actions/download-artifact@v4 @@ -85,7 +85,8 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(echo ${{ steps.load-image.outputs }} | sed 's/sha256://g' | tr '\n' ' ') + $(echo ${{ steps.load-image.outputs.AMD64_IMAGE_SHA }} | sed 's/sha256://g' | tr '\n' ' ') \ + $(echo ${{ steps.load-image.outputs.ARM64_IMAGE_SHA }} | sed 's/sha256://g' | tr '\n' ' ') - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 -- cgit v1.2.3 From cb5c035bbae4c3b2d2c7a8bdbffd6db409fbb9ab Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:09:55 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 454a023..819441f 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -34,8 +34,8 @@ jobs: shell: bash id: load-image run: | - echo "AMD64_IMAGE_SHA=$(docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar)" >> $GITHUB_ENV" - echo "ARM64_IMAGE_SHA=$(docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar)" >> $GITHUB_ENV" + echo "AMD64_IMAGE_SHA=$(docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar)" >> $GITHUB_ENV + echo "ARM64_IMAGE_SHA=$(docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar)" >> $GITHUB_ENV - name: Download Docker metadata uses: actions/download-artifact@v4 -- cgit v1.2.3 From d5f03c0df7815b9de66ad0fef15c41eddc1eb6e5 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:20:54 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 819441f..e4d58fd 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -32,10 +32,9 @@ jobs: - name: Load image shell: bash - id: load-image run: | - echo "AMD64_IMAGE_SHA=$(docker image import --platform linux/amd64 /tmp/images/image-linux-amd64.tar)" >> $GITHUB_ENV - echo "ARM64_IMAGE_SHA=$(docker image import --platform linux/arm64 /tmp/images/image-linux-arm64.tar)" >> $GITHUB_ENV + docker load -i /tmp/images/image-linux-amd64.tar + docker load -i /tmp/images/image-linux-arm64.tar - name: Download Docker metadata uses: actions/download-artifact@v4 @@ -85,8 +84,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(echo ${{ steps.load-image.outputs.AMD64_IMAGE_SHA }} | sed 's/sha256://g' | tr '\n' ' ') \ - $(echo ${{ steps.load-image.outputs.ARM64_IMAGE_SHA }} | sed 's/sha256://g' | tr '\n' ' ') + $(printf '%s ' *) - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 @@ -96,7 +94,7 @@ jobs: message: | #### :package: :robot: A new release has been made for this pull request. - To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ github.event.number }}` or `${{ env.REGISTRY_IMAGE }}:${{ github.event.pull_request.head.sha }}`. + To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ steps.pull_request_number_reader.outputs.content }}` or `${{ env.REGISTRY_IMAGE }}:${{ github.event.pull_request.head.sha }}`. Images are available for x86_64 and ARM64. -- cgit v1.2.3 From de56180036b99076893d9882519d82938de26335 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:30:37 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index e4d58fd..c21de15 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -84,7 +84,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(printf '%s ' *) + $(printf 'sha256:%s ' *) - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 -- cgit v1.2.3 From 7f274980b51001a84041d80149a0da9952c3c286 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:51:33 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 47 ++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index c21de15..ca56b6c 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -18,6 +18,16 @@ jobs: attestations: write id-token: write steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 + - name: Download images uses: actions/download-artifact@v4 with: @@ -27,15 +37,30 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_PAT }} - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - name: Load image shell: bash run: | docker load -i /tmp/images/image-linux-amd64.tar docker load -i /tmp/images/image-linux-arm64.tar + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GH_PAT }} + + - name: Push images + working-directory: /tmp/digests + run: | + for file in ./*; do + hash=$(basename "$file") + + docker push "sha256:$hash" + done + - name: Download Docker metadata uses: actions/download-artifact@v4 with: @@ -64,22 +89,6 @@ jobs: with: path: /tmp/pull_request_number/pull_request_number/pull_request_number.txt - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GH_PAT }} - - name: Create manifest list and push working-directory: /tmp/digests run: | -- cgit v1.2.3 From 62b569d26b4b13708f4d3a2b38b857d4bcad63af Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 23:09:29 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index ca56b6c..007a270 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -43,23 +43,24 @@ jobs: docker load -i /tmp/images/image-linux-amd64.tar docker load -i /tmp/images/image-linux-arm64.tar - - name: Download digests + - name: Download SHA uses: actions/download-artifact@v4 with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true + path: /tmp/SHA + pattern: sha run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_PAT }} + - name: Read the sha.txt file + id: sha_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: /tmp/SHA/sha/sha.txt + - name: Push images - working-directory: /tmp/digests run: | - for file in ./*; do - hash=$(basename "$file") - - docker push "sha256:$hash" - done + docker push ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-amd64 + docker push ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-arm64 - name: Download Docker metadata uses: actions/download-artifact@v4 @@ -92,8 +93,7 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') \ - $(printf 'sha256:%s ' *) + docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-amd64 ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-arm64 - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 @@ -103,8 +103,8 @@ jobs: message: | #### :package: :robot: A new release has been made for this pull request. - To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ steps.pull_request_number_reader.outputs.content }}` or `${{ env.REGISTRY_IMAGE }}:${{ github.event.pull_request.head.sha }}`. + To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ steps.pull_request_number_reader.outputs.content }}`. Images are available for x86_64 and ARM64. - > Latest commit: ${{ github.event.pull_request.head.sha }} + > Latest commit: ${{ steps.sha_reader.outputs.content }} -- cgit v1.2.3 From 0978d40e9517e633555d619b003c3119d7a0042c Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 15:43:55 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 007a270..cfc492d 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -51,16 +51,15 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_PAT }} - - name: Read the sha.txt file - id: sha_reader - uses: juliangruber/read-file-action@v1.0.0 - with: - path: /tmp/SHA/sha/sha.txt + - name: Read SHA + shell: bash + run: | + echo "SHA=$(cat /tmp/SHA/sha/sha.txt | tr -d '\n')" >> $GITHUB_ENV - name: Push images run: | - docker push ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-amd64 - docker push ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-arm64 + docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-amd64 + docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-arm64 - name: Download Docker metadata uses: actions/download-artifact@v4 @@ -93,7 +92,7 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-amd64 ${{ env.REGISTRY_IMAGE }}:${{ steps.sha_reader.outputs.content }}-arm64 + docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-amd64 ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-arm64 - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 @@ -107,4 +106,4 @@ jobs: Images are available for x86_64 and ARM64. - > Latest commit: ${{ steps.sha_reader.outputs.content }} + > Latest commit: ${{ env.SHA }} -- cgit v1.2.3 From 30c8b1310273aebef9799c943b1c27519f3ad425 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 15:48:38 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index cfc492d..1b9f8ef 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -58,8 +58,8 @@ jobs: - name: Push images run: | - docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-amd64 - docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-arm64 + docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-amd64 + docker push ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-arm64 - name: Download Docker metadata uses: actions/download-artifact@v4 @@ -92,7 +92,7 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-amd64 ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-arm64 + docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-amd64 ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-arm64 - name: Create comment uses: marocchino/sticky-pull-request-comment@v2 -- cgit v1.2.3 From 9751feb778cd3f7bf863d5e91d7c187980ce3da9 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 15:55:06 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 1b9f8ef..651840c 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -90,7 +90,6 @@ jobs: path: /tmp/pull_request_number/pull_request_number/pull_request_number.txt - name: Create manifest list and push - working-directory: /tmp/digests run: | docker buildx imagetools create $(cat /tmp/metadata/metadata/metadata.json | jq -cr '.tags | map("-t " + .) | join(" ")') ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-amd64 ${{ env.REGISTRY_IMAGE }}:${{ env.SHA }}-linux-arm64 @@ -99,6 +98,7 @@ jobs: with: header: "pr-release" number: ${{ steps.pull_request_number_reader.outputs.content }} + GITHUB_TOKEN: ${{ secrets.GH_PAT }} message: | #### :package: :robot: A new release has been made for this pull request. -- cgit v1.2.3 From de4a9193b6016ff15820914d9f06b6dd64649d3f Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 16:01:21 -0700 Subject: Update workflow --- .github/workflows/pr-release.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index 651840c..e121edd 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -83,11 +83,10 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_PAT }} - - name: Read the pull_request_number.txt file - id: pull_request_number_reader - uses: juliangruber/read-file-action@v1.0.0 - with: - path: /tmp/pull_request_number/pull_request_number/pull_request_number.txt + - name: Read PR number + shell: bash + run: | + echo "PR_NUMBER=$(cat /tmp/pull_request_number/pull_request_number/pull_request_number.txt | tr -d '\n')" >> $GITHUB_ENV - name: Create manifest list and push run: | @@ -97,12 +96,12 @@ jobs: uses: marocchino/sticky-pull-request-comment@v2 with: header: "pr-release" - number: ${{ steps.pull_request_number_reader.outputs.content }} + number: ${{ env.PR_NUMBER }} GITHUB_TOKEN: ${{ secrets.GH_PAT }} message: | #### :package: :robot: A new release has been made for this pull request. - To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ steps.pull_request_number_reader.outputs.content }}`. + To play around with this PR, pull `${{ env.REGISTRY_IMAGE }}:pr-${{ env.PR_NUMBER }}`. Images are available for x86_64 and ARM64. -- cgit v1.2.3 From 4c2f65ff2d8a49fb18dc7d5ff40e71534a1a8817 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 16:12:08 -0700 Subject: Fix PR publishing (#1068) --- .github/workflows/pr-snapshot.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/pr-snapshot.yml b/.github/workflows/pr-snapshot.yml index 882a5ad..88182cb 100644 --- a/.github/workflows/pr-snapshot.yml +++ b/.github/workflows/pr-snapshot.yml @@ -16,10 +16,8 @@ jobs: include: - runner-platform: ubuntu-latest build-arch: linux/amd64 - tagged-platform: amd64 - runner-platform: namespace-profile-default-arm64 build-arch: linux/arm64 - tagged-platform: arm64 runs-on: ${{ matrix.runner-platform }} steps: - name: Prepare @@ -52,24 +50,41 @@ jobs: id: build uses: docker/build-push-action@v6 with: - outputs: type=docker,dest=/tmp/image.tar - tags: ${{ steps.meta.outputs.tags }} + outputs: type=docker,dest=/tmp/image-${{ env.PLATFORM_PAIR }}.tar platforms: ${{ matrix.build-arch }} + tags: | + ${{ env.REGISTRY_IMAGE }}:${{ github.sha }}-${{ env.PLATFORM_PAIR }} build-args: | COMMIT_HASH=${{ github.sha }} BUILD_DATE=${{ steps.current-time.outputs.time }} - - name: Export digest + - name: Export Docker meta output + shell: bash + run: echo $DOCKER_METADATA_OUTPUT_JSON > /tmp/metadata.json + + - name: Upload metadata + uses: actions/upload-artifact@v4 + with: + name: metadata + path: /tmp/metadata.json + overwrite: true + + - name: Export SHA run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" + echo "${{ github.sha }}" > /tmp/sha.txt + + - name: Upload SHA + uses: actions/upload-artifact@v4 + with: + name: sha + path: /tmp/sha.txt + overwrite: true - name: Upload image uses: actions/upload-artifact@v4 with: name: image-${{ env.PLATFORM_PAIR }} - path: /tmp/image.tar + path: /tmp/image-${{ env.PLATFORM_PAIR }}.tar if-no-files-found: error retention-days: 1 -- cgit v1.2.3 From 52df7d42f1e9f46a669ca918ff7dec699cedf087 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 16:14:31 -0700 Subject: Update readme, changelog, release workflow --- .github/workflows/publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7e7a4f6..0a7b5c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,9 @@ on: tags: - 'v*' +env: + REGISTRY_IMAGE: ghcr.io/museofficial/muse + jobs: publish: strategy: @@ -53,7 +56,7 @@ jobs: push: true tags: | codetheweb/muse:${{ github.sha }}-${{ matrix.tagged-platform }} - ghcr.io/museofficial/muse:${{ github.sha }}-${{ matrix.tagged-platform }} + ${{ env.REGISTRY_IMAGE }}:${{ github.sha }}-${{ matrix.tagged-platform }} platforms: ${{ matrix.build-arch }} build-args: | COMMIT_HASH=${{ github.sha }} @@ -92,13 +95,13 @@ jobs: id: get-tags-ghcr uses: Surgo/docker-smart-tag-action@v1 with: - docker_image: codetheweb/muse + docker_image: ${{ env.REGISTRY_IMAGE }} - name: Combine tags (Docker Hub) run: docker buildx imagetools create $(echo '${{ steps.get-tags-dockerhub.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/muse:${{ github.sha }}-arm64' 'codetheweb/muse:${{ github.sha }}-amd64' - name: Combine tags (GitHub Container Registry) - run: docker buildx imagetools create $(echo '${{ steps.get-tags-ghcr.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'ghcr.io/museofficial/muse:${{ github.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.sha }}-amd64' + run: docker buildx imagetools create $(echo '${{ steps.get-tags-ghcr.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') '${{ env.REGISTRY_IMAGE }}:${{ github.sha }}-arm64' '${{ env.REGISTRY_IMAGE }}:${{ github.sha }}-amd64' - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v2.4.3 -- cgit v1.2.3 From 069774e7094a7f40ba230cad8a190e0fb34dce0d Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 16:15:00 -0700 Subject: Release 2.9.2 --- .github/workflows/publish.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a7b5c3..a279abe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,6 +66,11 @@ jobs: name: Combine platform tags runs-on: ubuntu-latest needs: publish + permissions: + contents: read + packages: write + attestations: write + id-token: write steps: - uses: actions/checkout@v1 -- cgit v1.2.3 From fb4d7885f71f5e4fbbf0a4d34d0e844bf4eeff32 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 18 Aug 2024 16:27:20 -0700 Subject: Fix PAT for release comments --- .github/workflows/release-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/release-comment.yml b/.github/workflows/release-comment.yml index ab042ac..af122e7 100644 --- a/.github/workflows/release-comment.yml +++ b/.github/workflows/release-comment.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: apexskier/github-release-commenter@v1 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_PAT }} comment-template: | 🚀 Released in {release_link}. -- cgit v1.2.3