Skip to content

Version 1.1.0

Version 1.1.0 #8

Workflow file for this run

name: Release
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Build
run: |
go build -v -o tailservice-${{ matrix.os }}-${{ matrix.arch }} -ldflags="-X 'cmd.Version=${{ github.event.release.tag_name }}'" main.go
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
- name: Upload Release Assets
uses: SierraSoftworks/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
files: |
tailservice-${{ matrix.os }}-${{ matrix.arch }}
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: set environment variables
run: |
image="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
image="$(echo $image | tr '[:upper:]' '[:lower:]')"
echo "FULL_IMAGE_NAME=${image}" >> $GITHUB_ENV
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.FULL_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}