From b4741be2fbb44337c03dd2fdffe01efe94e999e8 Mon Sep 17 00:00:00 2001 From: 0xOsiris Date: Mon, 10 Feb 2025 11:56:48 -0700 Subject: [PATCH] try to patch release workflow --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adaa2d6..b1aabe7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,10 @@ -name: release +name: Release on: workflow_dispatch: push: - branches: - - main tags: - - v* + - 'v*' env: IMAGE_NAME: ${{ github.repository }} @@ -16,13 +14,32 @@ env: permissions: contents: read packages: write - + jobs: - build-and-push: - runs-on: ubuntu-latest + build: + name: Publish Docker Image + strategy: + matrix: + config: + - platform: linux/amd64 + runner: warp-ubuntu-latest-x64-16x + - platform: linux/arm64 + runner: warp-ubuntu-latest-arm64-16x + runs-on: ${{ matrix.config.runner }} steps: - - name: Check Out Repo - uses: actions/checkout@v4 + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Set env + run: | + platform=${{ matrix.config.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Print version + run: | + echo $RELEASE_VERSION + echo ${{ env.RELEASE_VERSION }} - name: Log in to Registry uses: docker/login-action@v3 @@ -49,14 +66,18 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v5 + id: build + uses: docker/build-push-action@v6 with: + cache-from: type=gha + cache-to: type=gha,mode=max context: . file: Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} + build-args: | + VERSION=${{ env.RELEASE_VERSION }} + platforms: ${{ matrix.config.platform }} labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} annotations: ${{ steps.meta.outputs.annotations }} - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file +