From 44c9f88ba9304c3a6b5767a92107ba7978b3b959 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Mon, 15 Aug 2022 10:44:13 +0100 Subject: [PATCH] build: Optimise Docker build (#365) --- .github/workflows/release.yml | 15 ++++++++++++--- .goreleaser.yml | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a69b85782..13848c5d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Required to fetch version + persist-credentials: false - uses: actions/setup-go@v3 with: @@ -34,6 +35,10 @@ jobs: cache: 'npm' cache-dependency-path: '**/package-lock.json' + # Setup for pushing to Buf.build later + - uses: bufbuild/buf-setup-action@v1.7.0 + + # Required for short-lived token provided to Semantic Release - name: "Obtain Github App token" id: app-token uses: getsentry/action-github-app-token@v1.0.6 @@ -64,6 +69,12 @@ jobs: RELEASE_VERSION=$( git describe --tags ${{ github.sha }}) echo ::set-output name=RELEASE_VERSION::"$RELEASE_VERSION" + # Push Protobufs to Buf.build registry + - uses: bufbuild/buf-push-action@v1 + with: + input: proto + buf_token: ${{ secrets.BUF_TOKEN }} + release-docker: name: "Docker image" needs: release-binary @@ -73,15 +84,13 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Required to fetch version + persist-credentials: false - uses: actions/setup-go@v3 with: go-version-file: ./go.mod cache: true - - name: Generate golang code - run: make proto-gen - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 id: buildx diff --git a/.goreleaser.yml b/.goreleaser.yml index 69732b4d9..84228dfe4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -50,7 +50,7 @@ checksum: algorithm: sha256 changelog: - use: github + use: github-native sort: asc groups: - title: Features