From 440010545f45c75948d39b967df9a1c5b4269410 Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Wed, 22 Sep 2021 15:35:12 +0200 Subject: [PATCH] Temporarily use buildah instead of goreleaser to build image Signed-off-by: Kemal Akkoyun --- .github/workflows/container.yml | 6 ++---- .github/workflows/release.yml | 32 +++++++++++++++++++++++++------- .goreleaser.yml | 20 +++++++++++--------- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index ffe7fb74ed1..66b23c22c16 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -1,4 +1,4 @@ -name: Go +name: Container on: push: @@ -8,13 +8,11 @@ on: jobs: build: - name: Container build + name: Container build and push runs-on: ubuntu-latest steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Initialize and update libbpf submodule - run: git submodule init && git submodule update - name: Get branch name shell: bash run: echo "GITHUB_BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db18c6b86b5..7077ef6b1bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,12 +25,13 @@ jobs: - name: Build UI run: make ui - - name: Login to Github Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # Disabled until fixing the authentication issue. + # - name: Login to Github Container Registry + # uses: docker/login-action@v1 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # GITHUB_TOKEN - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 @@ -39,4 +40,21 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + container: + name: Container build and push + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Build container + env: + TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: make container + - name: Login to registry + run: | + echo "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | buildah login -u parca-dev --password-stdin ghcr.io + - name: Push container + run: | + make push-container diff --git a/.goreleaser.yml b/.goreleaser.yml index efa461ed43c..8610faac1b5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -28,12 +28,14 @@ changelog: exclude: - '^docs:' - '^test:' -dockers: - - id: parca - goos: linux - goarch: amd64 - dockerfile: Dockerfile.release - extra_files: - - parca.yaml - image_templates: - - ghcr.io/parca-dev/parca:{{ .Tag }} + +# Disabled until fixing the authentication issue with ghcr. +#dockers: +# - id: parca +# goos: linux +# goarch: amd64 +# dockerfile: Dockerfile.release +# extra_files: +# - parca.yaml +# image_templates: +# - ghcr.io/parca-dev/parca:{{ .Tag }}