From 933802b897bb64fec2beebabc696aba4921be68d Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 24 Jun 2024 11:34:55 -0700 Subject: [PATCH 1/7] Use "master" label for master container build --- .github/workflows/container-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index e44ac200..edb03489 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -58,7 +58,7 @@ jobs: images: quay.io/invidious/invidious tags: | type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w @@ -83,7 +83,7 @@ jobs: suffix=-arm64 tags: | type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w From 848ab1e9c866f8e55467697e18a4ef35503cc936 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 24 Jun 2024 11:36:11 -0700 Subject: [PATCH 2/7] Specify which workflow builds from master --- .github/workflows/container-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index edb03489..55a791b6 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -1,4 +1,4 @@ -name: Build and release container +name: Build and release container directly from master on: push: From dd38eef41aefd5dd0dc40f21489b9b6cb8269333 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 24 Jun 2024 11:45:00 -0700 Subject: [PATCH 3/7] Add workflow to build container on release --- .github/workflows/release-container.yml | 89 +++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/release-container.yml diff --git a/.github/workflows/release-container.yml b/.github/workflows/release-container.yml new file mode 100644 index 00000000..9129c699 --- /dev/null +++ b/.github/workflows/release-container.yml @@ -0,0 +1,89 @@ +name: Build and release container + +on: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Crystal + uses: crystal-lang/install-crystal@v1.8.2 + with: + crystal: 1.12.2 + + - name: Run lint + run: | + if ! crystal tool format --check; then + crystal tool format + git diff + exit 1 + fi + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + tags: | + type=semvar,pattern={{version}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + labels: | + quay.expires-after=12w + + - name: Build and push Docker AMD64 image for Push Event + uses: docker/build-push-action@v5 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64 + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} + build-args: | + "release=1" + + - name: Docker meta + id: meta-arm64 + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + flavor: | + suffix=-arm64 + tags: | + type=semvar,pattern={{version}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + labels: | + quay.expires-after=12w + + - name: Build and push Docker ARM64 image for Push Event + uses: docker/build-push-action@v5 + with: + context: . + file: docker/Dockerfile.arm64 + platforms: linux/arm64/v8 + labels: ${{ steps.meta-arm64.outputs.labels }} + push: true + tags: ${{ steps.meta-arm64.outputs.tags }} + build-args: | + "release=1" From 8f5c6a602b78e34e42d1c58ed888e9c8a70ddaa7 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 1 Jul 2024 21:35:08 -0700 Subject: [PATCH 4/7] Rename container workflows --- .../{container-release.yml => build-nightly-container.yml} | 0 .../{release-container.yml => build-stable-container.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{container-release.yml => build-nightly-container.yml} (100%) rename .github/workflows/{release-container.yml => build-stable-container.yml} (100%) diff --git a/.github/workflows/container-release.yml b/.github/workflows/build-nightly-container.yml similarity index 100% rename from .github/workflows/container-release.yml rename to .github/workflows/build-nightly-container.yml diff --git a/.github/workflows/release-container.yml b/.github/workflows/build-stable-container.yml similarity index 100% rename from .github/workflows/release-container.yml rename to .github/workflows/build-stable-container.yml From 64d1f26eceb735ab5c96644b6545fe7fe5c2e677 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 1 Jul 2024 21:39:14 -0700 Subject: [PATCH 5/7] Fix trigger for stable container build --- .github/workflows/build-stable-container.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-stable-container.yml b/.github/workflows/build-stable-container.yml index 9129c699..032fd762 100644 --- a/.github/workflows/build-stable-container.yml +++ b/.github/workflows/build-stable-container.yml @@ -1,8 +1,9 @@ name: Build and release container on: - tags: - - "v*" + push: + tags: + - "v*" jobs: release: From aace30b2b47b715021a2ab661f9dec4b727604b8 Mon Sep 17 00:00:00 2001 From: syeopite Date: Thu, 4 Jul 2024 10:11:36 -0700 Subject: [PATCH 6/7] Bump nightly container build workflow crystal ver --- .github/workflows/build-nightly-container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nightly-container.yml b/.github/workflows/build-nightly-container.yml index 55a791b6..bee27600 100644 --- a/.github/workflows/build-nightly-container.yml +++ b/.github/workflows/build-nightly-container.yml @@ -24,9 +24,9 @@ jobs: uses: actions/checkout@v4 - name: Install Crystal - uses: crystal-lang/install-crystal@v1.8.0 + uses: crystal-lang/install-crystal@v1.8.2 with: - crystal: 1.9.2 + crystal: 1.12.2 - name: Run lint run: | From 220cc9bd2ff87872763899f730a8ba62d45db7dd Mon Sep 17 00:00:00 2001 From: syeopite Date: Thu, 4 Jul 2024 10:13:01 -0700 Subject: [PATCH 7/7] Typo Co-authored-by: Samantaz Fox --- .github/workflows/build-stable-container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-stable-container.yml b/.github/workflows/build-stable-container.yml index 032fd762..b5fbc705 100644 --- a/.github/workflows/build-stable-container.yml +++ b/.github/workflows/build-stable-container.yml @@ -47,7 +47,7 @@ jobs: with: images: quay.io/invidious/invidious tags: | - type=semvar,pattern={{version}} + type=semver,pattern={{version}} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w @@ -72,7 +72,7 @@ jobs: flavor: | suffix=-arm64 tags: | - type=semvar,pattern={{version}} + type=semver,pattern={{version}} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} labels: | quay.expires-after=12w