From eeeb0f19fd0bea2143a41bfcf820d78f140bc1a7 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 6 Dec 2023 06:23:14 -0800 Subject: [PATCH] Fix release workflows (#8) Signed-off-by: Tamal Saha --- .github/workflows/ci.yml | 19 +++++------- .github/workflows/release-tracker.yml | 4 +-- .github/workflows/release.yml | 42 ++++++++++++++++++--------- .github/workflows/update-docs.yml | 8 ++--- Makefile | 2 +- 5 files changed, 43 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43f9ae0a..c25c0adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,31 +7,26 @@ on: push: branches: - master - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true jobs: build: name: Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: '1.20' + go-version: '1.21' id: go - name: Check out code into the Go module directory uses: actions/checkout@v1 - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Run checks run: | - make ci \ No newline at end of file + make ci diff --git a/.github/workflows/release-tracker.yml b/.github/workflows/release-tracker.yml index 95cdd520..24d5afa7 100644 --- a/.github/workflows/release-tracker.yml +++ b/.github/workflows/release-tracker.yml @@ -11,7 +11,7 @@ concurrency: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 @@ -38,4 +38,4 @@ jobs: GITHUB_USER: 1gtm GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} run: | - ./hack/scripts/update-release-tracker.sh \ No newline at end of file + ./hack/scripts/update-release-tracker.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbe736c9..21011c3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,20 +4,20 @@ on: push: tags: - "*.*" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true jobs: build: name: Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out code into the Go module directory uses: actions/checkout@v1 - - name: Install GitHub CLI - run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - sudo mv bin/hub /usr/local/bin - - name: Print version info id: semver run: | @@ -30,15 +30,31 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Publish to GitHub Container Registry + - name: Build env: - REGISTRY: ghcr.io/kubestash - DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} - USERNAME: 1gtm APPSCODE_ENV: prod run: | - docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN} - make release + make release COMPRESS=yes + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + bin/kubectl-kubestash-darwin-amd64.tar.gz + bin/kubectl-kubestash-darwin-arm64.tar.gz + bin/kubectl-kubestash-linux-amd64.tar.gz + bin/kubectl-kubestash-linux-arm.tar.gz + bin/kubectl-kubestash-linux-arm64.tar.gz + bin/kubectl-kubestash-windows-amd64.zip + bin/kubectl-kubestash-checksums.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install GitHub CLI + run: | + curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 + sudo mv bin/hub /usr/local/bin - name: Clone krew-index repository env: @@ -60,4 +76,4 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.') || contains(github.ref, '-rc.')) == false run: | cd $RUNNER_WORKSPACE/krew-index - ./hack/scripts/open-pr.sh $GITHUB_WORKSPACE kubestash \ No newline at end of file + ./hack/scripts/open-pr.sh $GITHUB_WORKSPACE kubestash diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 173a4314..d3bfcb69 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -13,12 +13,12 @@ concurrency: jobs: build: name: Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: '1.20' + go-version: '1.21' id: go - uses: actions/checkout@v1 @@ -49,4 +49,4 @@ jobs: run: | export DOCS_ROOT=$RUNNER_WORKSPACE/$(basename $DOCS_REPOSITORY) ./hack/gendocs/make.sh - $DOCS_ROOT/hack/scripts/open-pr.sh \ No newline at end of file + $DOCS_ROOT/hack/scripts/open-pr.sh diff --git a/Makefile b/Makefile index e3b960ff..5c961e7a 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64 darwin/arm64 OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -GO_VERSION ?= 1.20 +GO_VERSION ?= 1.21 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) RESTIC_VER := 0.16.0