Skip to content

chore: Correct VERSION file to have proper semver (#91) #11

chore: Correct VERSION file to have proper semver (#91)

chore: Correct VERSION file to have proper semver (#91) #11

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
test:
uses: ./.github/workflows/e2e-tests.yml
with:
clientId: "${{ vars.SLOCTL_CLIENT_ID }}"
ref: "${{ github.ref_name }}"
secrets:
clientSecret: "${{ secrets.SLOCTL_CLIENT_SECRET }}"
qa-approval:
runs-on: ubuntu-latest
environment: qa-approval
steps:
- name: No-op approval
run: echo "This is a no-op step, QA needs to approve it and may perform testing beforehand"
management-approval:
runs-on: ubuntu-latest
environment: management-approval
steps:
- name: No-op approval
run: echo "This is a no-op step, management needs to approve it"
goreleaser:
runs-on: ubuntu-latest
needs: [test, qa-approval, management-approval]
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
nobl9/sloctl
quay.io/nobl9/sloctl
flavor: |
latest=true
tags: |
type=sha
type=semver,pattern={{version}}
- name: Release Binaries
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64, linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: LDFLAGS=-s -w -X github.com/nobl9/sloctl/internal.BuildVersion=${{ github.ref_name }}