Skip to content

Create release

Create release #4

Workflow file for this run

name: Create release
on:
workflow_dispatch:
jobs:
build:
name: Build Executables
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { go-version: 1.23, go-os: linux, go-arch: amd64 }
- { go-version: 1.23, go-os: linux, go-arch: 386 }
- { go-version: 1.23, go-os: linux, go-arch: arm64 }
- { go-version: 1.23, go-os: linux, go-arch: arm }
- { go-version: 1.23, go-os: linux, go-arch: loong64 }
- { go-version: 1.23, go-os: linux, go-arch: mips }
- { go-version: 1.23, go-os: linux, go-arch: mips64 }
- { go-version: 1.23, go-os: linux, go-arch: mips64le }
- { go-version: 1.23, go-os: linux, go-arch: mipsle }
- { go-version: 1.23, go-os: linux, go-arch: ppc64 }
- { go-version: 1.23, go-os: linux, go-arch: ppc64le }
- { go-version: 1.23, go-os: linux, go-arch: riscv64 }
- { go-version: 1.23, go-os: linux, go-arch: s390x }
- { go-version: 1.23, go-os: openbsd, go-arch: amd64 }
- { go-version: 1.23, go-os: openbsd, go-arch: 386 }
- { go-version: 1.23, go-os: openbsd, go-arch: arm64 }
- { go-version: 1.23, go-os: openbsd, go-arch: arm }
- { go-version: 1.23, go-os: openbsd, go-arch: ppc64 }
- { go-version: 1.23, go-os: freebsd, go-arch: amd64 }
- { go-version: 1.23, go-os: freebsd, go-arch: 386 }
- { go-version: 1.23, go-os: freebsd, go-arch: arm64 }
- { go-version: 1.23, go-os: freebsd, go-arch: arm }
- { go-version: 1.23, go-os: freebsd, go-arch: riscv64 }
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build binary
run: go build .
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.go-os }}
GOARCH: ${{ matrix.go-arch }}
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: goflow-${{ matrix.go-os }}-${{ matrix.go-arch }}
path: goflow
release:
name: Release
needs: build
runs-on: ubuntu-latest
timeout-minutes: 1440
permissions:
actions: read
contents: write
packages: write
security-events: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
preset: conventionalcommits
github-token: ${{ secrets.GITHUB_TOKEN }}
git-user-name: ${{ github.actor }}
git-user-email: ${{ github.actor }}@users.noreply.github.com
input-file: '.github/CHANGELOG.md'
output-file: '.github/CHANGELOG.md'
release-count: 10000
skip-on-empty: false
skip-version-file: 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 GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ghcr.io/${{ github.repository }}:test
- name: Test Docker Image
run: |
docker run --rm ghcr.io/${{ github.repository }}:test --help
- name: Build and push Docker Image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: .
tags: ghcr.io/${{ github.repository }}:${{ steps.changelog.outputs.tag }}, ghcr.io/${{ github.repository }}:latest
push: true
- name: Download workflow artifacts
uses: actions/download-artifact@v4
with:
pattern: goflow-*
- name: Create Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
token: ${{ secrets.GITHUB_TOKEN }}
files: goflow*/goflow*