Skip to content

add windows build

add windows build #34

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
tags:
- v*
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version-file: 'go.mod'
# local build
#- name: Compile the binary
# run: |
# make bin/goldpinger
# ./bin/goldpinger -h
#
# # simple Docker build
# - name: Build the Docker image
# run: |
# make build
# docker run `make version` --help
- name: Login to GitHub Container Registry
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to DockerHub
# uses: docker/login-action@v1
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# multi-arch build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
bake-target: docker-metadata-action
images: |
ghcr.io/${{ github.repository_owner }}/goldpinger
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build regular image
uses: docker/bake-action@v4
with:
targets: ci
push: true
# push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}