Optimize Github action workflows for Go version identification (#2533)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2022-09-06 17:30:21 +05:30
committed by GitHub
parent 7dad7c8399
commit 294ff5bb19
7 changed files with 147 additions and 163 deletions
+39 -40
View File
@@ -6,7 +6,6 @@ on:
- v2.**
env:
GO_VERSION: 1.19
KIND_VERSION: v0.14.0
KIND_NODE_IMAGE_TAG: v1.19.16
@@ -14,50 +13,50 @@ jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
install-only: true
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
install-only: true
- name: Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
version: ${{ env.KIND_VERSION }}
config: kind.yaml
- name: Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
version: ${{ env.KIND_VERSION }}
config: kind.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release
env:
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_CLI_EXPERIMENTAL: "enabled"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release
env:
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_CLI_EXPERIMENTAL: "enabled"
#ToDo - Verify and upload releases
#ToDo - Verify and upload releases