Skip to content

Commit

Permalink
build binaries
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Feb 28, 2024
1 parent 07e9470 commit 41da3a4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 15 deletions.
62 changes: 48 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,60 @@
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
branch:
description: "Branch"
required: true
default: "main"
tag:
description: "Release Tag"



jobs:
binary:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- run: go version
-
name: Build
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build
-
name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: compose-spec
path: ./bin/*
if-no-files-found: error

release:
runs-on: ubuntu-latest
permissions:
contents: write # to create a release (ncipollo/release-action)
runs-on: ubuntu-latest
needs:
- binary
steps:
- name: Release it!
if: ${{ github.event.inputs.tag != '' }} # don't release if no tag is specified
-
name: Checkout
uses: actions/checkout@v3
-
name: Download artifacts
uses: actions/download-artifact@v3
with:
name: compose-spec
path: bin/release
-
name: GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: bin/release/*
generateReleaseNotes: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.tag }}
commit: ${{ github.event.inputs.branch }}
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

IMAGE_PREFIX=composespec/conformance-tests-

ifeq ($(OS),Windows_NT)
BINARY_EXT=.exe
endif

.PHONY: build
build: ## Build command line
go build -o bin/compose-spec cmd/main.go
go build -o bin/compose-spec-$(GOOS)-$(GOARCH)$(BINARY_EXT) cmd/main.go

.PHONY: test
test: ## Run tests
Expand Down

0 comments on commit 41da3a4

Please sign in to comment.