Skip to content

Release

Release #246

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
goreleaser:
description: Create Github release artifacts
required: true
type: boolean
releaseType:
description: Release type
required: true
type: choice
options: [dev, release]
env:
GO_VERSION: "1.23"
jobs:
goreleaser:
name: Create Github release
runs-on: ubuntu-latest
if: github.event.inputs.releaseType == 'release' && github.event.inputs.goreleaser
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: Build Docker images
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64/v8
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/digineo/texd
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}
latest
- name: Release meta
uses: actions/github-script@v7
id: release-meta
with:
script: |
const isRelease = context.payload.inputs.releaseType === 'release' ? '1' : '0'
return { isRelease }
- name: Docker image
uses: docker/build-push-action@v6
with:
file: ./.github/Dockerfile.release
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
IS_RELEASE=${{ steps.release-meta.outputs.result.isRelease }}
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .