Skip to content

v1.0.5

v1.0.5 #24

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
release-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
linux/arm/v7
linux/arm/v6
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
build-args: |
version=${{ github.event.release.tag_name }}
release-binaries:
strategy:
matrix:
go:
- goarch: 'amd64'
gosuffix: 'amd64'
- goarch: 'arm64'
gosuffix: 'arm64'
- goarch: 'arm'
goarm: '7'
gosuffix: 'armv7'
- goarch: 'arm'
goarm: '6'
gosuffix: 'armv6'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Build binary
run: |
version="${{ github.event.release.tag_name }}"
builddate=$(date +'%Y-%m-%d')
ldflags="-s -w -X main.version=$version -X main.build=$builddate"
export GOOS=linux
export GOARCH=${{ matrix.go.goarch }}
export GOARM=${{ matrix.go.goarm }}
filename="valetudopng_${version}_${GOOS}_${{ matrix.go.gosuffix }}"
go build -ldflags "$ldflags" -o "$filename" ./cmd/valetudopng/main.go
- name: Compress binary
run: |
for file in valetudopng_*; do
tar -czvf "${file}.tar.gz" "$file"
done
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: valetudopng_*.tar.gz
tag: ${{ github.event.release.tag_name }}
overwrite: true
file_glob: true