Publish binaries on release

Relates-To: #414
Change-Id: I4a84129e0f04553d27203dc7d945a9893e164108
This commit is contained in:
Sean Eagan 2020-11-16 16:56:36 -06:00 committed by Sean Eagan
parent 9ab2ed96b7
commit 55aa0837b7
2 changed files with 64 additions and 8 deletions

View File

@ -108,13 +108,14 @@ jobs:
env: env:
TAGS: ${{ github.ref }} TAGS: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release - name: Setup Go
id: create_release uses: actions/setup-go@v2
uses: actions/create-release@v1 with:
go-version: 1.13.x
- name: Generate binaries and create github release
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --release-notes=release-notes.md --skip-validate --debug
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: release-notes.md
draft: true

55
.goreleaser.yaml Normal file
View File

@ -0,0 +1,55 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
builds:
- <<: &build_defaults
binary: airshipctl
flags:
- -tags=netgo
- -trimpath
ldflags:
- '-extldflags "-static"'
- -X opendev.org/airship/airshipctl/pkg/version.gitVersion={{ .Version }}
env:
- CGO_ENABLED=0
id: linux
goos:
- linux
goarch:
- amd64
- arm64
- arm
goarm:
- 7
- <<: *build_defaults
id: darwin
goos:
- darwin
- <<: *build_defaults
id: windows
goos:
- windows
archives:
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
id: nix
builds: [linux, darwin]
format: tar.gz
files:
- none*
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
id: windows
builds: [windows]
format: zip
files:
- none*
release:
draft: true