Skip to content

Commit 10ffb27

Browse files
committed
build binaries
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 50501d2 commit 10ffb27

File tree

2 files changed

+53
-15
lines changed

2 files changed

+53
-15
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
name: Release
22
on:
3+
push:
4+
tags:
5+
- 'v*'
36
workflow_dispatch:
4-
inputs:
5-
branch:
6-
description: "Branch"
7-
required: true
8-
default: "main"
9-
tag:
10-
description: "Release Tag"
11-
12-
137

148
jobs:
9+
binary:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
os: [linux, darwin, windows]
14+
arch: [amd64, arm64]
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v4
19+
-
20+
name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: go.mod
24+
- run: go version
25+
-
26+
name: Build
27+
run: |
28+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build
29+
-
30+
name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: compose-spec
34+
path: ./bin/*
35+
if-no-files-found: error
36+
1537
release:
16-
runs-on: ubuntu-latest
38+
permissions:
39+
contents: write # to create a release (ncipollo/release-action)
40+
runs-on: ubuntu-latest
41+
needs:
42+
- binary
1743
steps:
18-
- name: Release it!
19-
if: ${{ github.event.inputs.tag != '' }} # don't release if no tag is specified
44+
-
45+
name: Checkout
46+
uses: actions/checkout@v4
47+
-
48+
name: Download artifacts
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: compose-spec
52+
path: bin/release
53+
-
54+
name: GitHub Release
2055
uses: ncipollo/release-action@v1
2156
with:
57+
artifacts: bin/release/*
2258
generateReleaseNotes: true
2359
draft: true
2460
token: ${{ secrets.GITHUB_TOKEN }}
25-
tag: ${{ github.event.inputs.tag }}
26-
commit: ${{ github.event.inputs.branch }}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414

1515
IMAGE_PREFIX=composespec/conformance-tests-
1616

17+
ifeq ($(OS),Windows_NT)
18+
BINARY_EXT=.exe
19+
endif
20+
1721
.PHONY: build
1822
build: ## Build command line
19-
go build -o bin/compose-spec cmd/main.go
23+
go build -o bin/compose-spec-$(GOOS)-$(GOARCH)$(BINARY_EXT) cmd/main.go
2024

2125
.PHONY: test
2226
test: ## Run tests

0 commit comments

Comments
 (0)