Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github action to build release artifacts #916

Merged
merged 7 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Build release artifacts"
on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Get version from tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "TRAVIS_TAG=${{ github.ref_name }}" >> $GITHUB_ENV

- run: make release
- run: make dgoss-sha256 dcgoss-sha256 kgoss-sha256

- name: "Upload binary as artifact"
uses: actions/upload-artifact@v4
with:
retention-days: 5
if-no-files-found: error
name: build
path: |
release/*
extras/*/*goss
extras/*/*goss.sha256

attach-assets:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: ["build"]
runs-on: ubuntu-latest
steps:
- name: Fetch all binaries
uses: actions/download-artifact@v4
- name: Attach to release
uses: softprops/action-gh-release@v2
with:
files: build/**
fail_on_unmatched_files: true
56 changes: 28 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ before_install:
script:
- ./ci/build.sh

deploy:
provider: releases
api_key:
secure: ijNltjw/mIHIOx8vLZ6asUun3SbY7D+XZbs5NX8vcIv0jvOiwaaT1hqny7SQBHfGZzqHsYUSS/GYAYJdBqKFFfGmTZsl90hFT6D0RGdz9C71UVxNFX4wQ5KQ/WVvdMT2SrLymGvu9TvoU0VG8OWqWVdxSlUPf6qOTGAagrzg+Tbsbb6czeiG67mlBBL23XSlfMG1p45UxzvI41SZj2R3ElUb0hym1CrFaoC36PBGrb0x41TXzvd8J7cu6xDzgczYhnYQQZpS6f2YcqNV1z0f+P67EQqQiDWIIcK2jE/YG+RgM8cbpLMiMec8CDiwNCsejBA5EbVMlGJlODvBXT5NmMBeugueqfSHEfkl5qZTQG4AOAT7UsqbnM7r0NqzmaE5Lj90igvJK6rNsH1ZRe79WfSsTtuzlkkouHGvyoz0M8gnMSzpbbwoyIy+UT0hhPMoZvIpXfr43en5WkbkPKfop0p4Vjc8NGg0iD45q1JAvIVTtz/WvWTknM1P8e3u+TiDTaZkcJJmFaBqgaeLoWktOGfi54p9nhgQnSyBYt4PyvhWDQs7QFmX0BdKlqJCESvUOJTe1t6zJJsV7Gn/3sGCN7JUEwbnXTsCoMjjFFUvQdm0Ur7t7/2xU3kO+dyfqcdM/5SYFeppQcjHI0ckhI51mIoBTsJsGvaVwKKL1I4cyBU=
file:
- release/goss-darwin-amd64
- release/goss-darwin-amd64.sha256
- release/goss-darwin-arm64
- release/goss-darwin-arm64.sha256
- release/goss-linux-amd64
- release/goss-linux-amd64.sha256
- release/goss-linux-386
- release/goss-linux-386.sha256
- release/goss-linux-arm
- release/goss-linux-arm.sha256
- release/goss-linux-arm64
- release/goss-linux-arm64.sha256
- release/goss-linux-s390x
- release/goss-linux-s390x.sha256
- release/goss-windows-amd64.exe
- release/goss-windows-amd64.exe.sha256
- extras/dgoss/dgoss
- extras/dgoss/dgoss.sha256
skip_cleanup: true
on:
repo: goss-org/goss
tags: true
condition: $TRAVIS_OS_NAME = linux
# deploy:
# provider: releases
# api_key:
# secure: ijNltjw/mIHIOx8vLZ6asUun3SbY7D+XZbs5NX8vcIv0jvOiwaaT1hqny7SQBHfGZzqHsYUSS/GYAYJdBqKFFfGmTZsl90hFT6D0RGdz9C71UVxNFX4wQ5KQ/WVvdMT2SrLymGvu9TvoU0VG8OWqWVdxSlUPf6qOTGAagrzg+Tbsbb6czeiG67mlBBL23XSlfMG1p45UxzvI41SZj2R3ElUb0hym1CrFaoC36PBGrb0x41TXzvd8J7cu6xDzgczYhnYQQZpS6f2YcqNV1z0f+P67EQqQiDWIIcK2jE/YG+RgM8cbpLMiMec8CDiwNCsejBA5EbVMlGJlODvBXT5NmMBeugueqfSHEfkl5qZTQG4AOAT7UsqbnM7r0NqzmaE5Lj90igvJK6rNsH1ZRe79WfSsTtuzlkkouHGvyoz0M8gnMSzpbbwoyIy+UT0hhPMoZvIpXfr43en5WkbkPKfop0p4Vjc8NGg0iD45q1JAvIVTtz/WvWTknM1P8e3u+TiDTaZkcJJmFaBqgaeLoWktOGfi54p9nhgQnSyBYt4PyvhWDQs7QFmX0BdKlqJCESvUOJTe1t6zJJsV7Gn/3sGCN7JUEwbnXTsCoMjjFFUvQdm0Ur7t7/2xU3kO+dyfqcdM/5SYFeppQcjHI0ckhI51mIoBTsJsGvaVwKKL1I4cyBU=
# file:
# - release/goss-darwin-amd64
# - release/goss-darwin-amd64.sha256
# - release/goss-darwin-arm64
# - release/goss-darwin-arm64.sha256
# - release/goss-linux-amd64
# - release/goss-linux-amd64.sha256
# - release/goss-linux-386
# - release/goss-linux-386.sha256
# - release/goss-linux-arm
# - release/goss-linux-arm.sha256
# - release/goss-linux-arm64
# - release/goss-linux-arm64.sha256
# - release/goss-linux-s390x
# - release/goss-linux-s390x.sha256
# - release/goss-windows-amd64.exe
# - release/goss-windows-amd64.exe.sha256
# - extras/dgoss/dgoss
# - extras/dgoss/dgoss.sha256
# skip_cleanup: true
# on:
# repo: goss-org/goss
# tags: true
# condition: $TRAVIS_OS_NAME = linux
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DOCS_DEPS := $(VENV)/.docs.dependencies

.PHONY: all build install test release bench fmt lint vet test-int-all gen centos7 wheezy trusty alpine3 arch test-int32 centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32

all: test-short-all test-int-all dgoss-sha256
all: test-short-all test-int-all dgoss-sha256 dcgoss-sha256 kgoss-sha256

test-short-all: fmt lint vet test

Expand Down Expand Up @@ -144,6 +144,12 @@ arch: build
dgoss-sha256:
cd extras/dgoss/ && sha256sum dgoss > dgoss.sha256

dcgoss-sha256:
cd extras/dcgoss/ && sha256sum dcgoss > dcgoss.sha256

kgoss-sha256:
cd extras/kgoss/ && sha256sum kgoss > kgoss.sha256

$(PYTHON):
$(info Creating virtualenv in $(VENV))
@python -m venv $(VENV)
Expand Down