Skip to content

Release 🚀

Release 🚀 #51

Workflow file for this run

name: Release 🚀
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "Release version(e.g. 1.0.0 or 1.0.0-rc1)"
prerelease:
type: boolean
description: "Mark as prerelease"
jobs:
update-source:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Update-version
run: make update-version VERSION=v${{ inputs.version }} PRERELEASE=${{ inputs.prerelease }}
- name: Commit updates
uses: EndBug/add-and-commit@v7
with:
branch: main
message: "Bump version: v${{ inputs.version }}"
create-release:
runs-on: ubuntu-latest
needs:
- update-source
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Setup Go
uses: actions/checkout@v4
with:
go-version-file: go.mod
- run: go version
- name: Create tag
run: |
git tag v${{ inputs.version }}
git push origin v${{ inputs.version }}
- name: Delete drafts
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: release-drafter
uses: release-drafter/release-drafter@v5
with:
name: "v${{ inputs.version }} 🌈"
tag: v${{ inputs.version }}
version: ${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
tag: v${{ inputs.version }}
docker-build-controller-manager:
runs-on: ubuntu-latest
needs:
- create-release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: dockerfile/controller-manager.Dockerfile
tags: ghcr.io/${{ github.repository_owner }}/cosmo-controller-manager:${{ needs.create-release.outputs.tag }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
docker-build-dashboard:
runs-on: ubuntu-latest
needs:
- create-release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: dockerfile/dashboard.Dockerfile
tags: ghcr.io/${{ github.repository_owner }}/cosmo-dashboard:${{ needs.create-release.outputs.tag }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}