Skip to content

v1.6.0

v1.6.0 #2

Workflow file for this run

name: Release Pipeline
on:
release:
types: [created]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: write
packages: write
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
go_version: 1.22
binary_name: "validator"
ldflags: -w -s -extldflags "-static" -X github.com/Boeing/config-file-validator.version=${{ github.event.release.tag_name }}
build_tags: -tags netgo
project_path: cmd/validator
extra_files: LICENSE README.md
registry-matrix:
name: Push Docker images to Container Registry
runs-on: ubuntu-latest
strategy:
matrix:
include:
- base: "alpine:3.19"
postfix: ""
- base: "scratch"
postfix: "-scratch"
- base: "ubuntu:20.04"
postfix: "-ubuntu"
steps:
- uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.postfix }}"
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.base }}
VALIDATOR_VERSION=${{ github.event.release.tag_name }}