forked from compose-spec/compose-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nicolas De Loof <[email protected]>
- Loading branch information
Showing
1 changed file
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '2.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 | ||
path: bin/release | ||
- | ||
name: GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
generateReleaseNotes: true | ||
draft: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.event.inputs.tag }} | ||
commit: ${{ github.event.inputs.branch }} |