Skip to content

Commit

Permalink
fix: release worklflow (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: francesco-racciatti <[email protected]>
  • Loading branch information
francesco-racciatti authored Dec 1, 2023
1 parent ed37978 commit b1660bd
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 71 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env:
GO_VERSION: 1.20.x

jobs:
test-cfn-runtime:
name: CFN Runtime
test-pkg-lib:
name: Test pkg lib
runs-on: ubuntu-latest

steps:
Expand All @@ -24,11 +24,11 @@ jobs:

- name: Test
run: |
cd runtimes/cloudformation
cd pkg
go test -v ./...
test-kilt-lib:
name: Kilt Lib
test-cfn-runtime:
name: Test CloudFormation Runtime
runs-on: ubuntu-latest

steps:
Expand All @@ -43,5 +43,23 @@ jobs:

- name: Test
run: |
cd pkg
cd runtimes/cloudformation
go test -v ./...
build-cfn-runtime:
name: Build CloudFormation runtime
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Check out code
uses: actions/checkout@v4

- name: Build agent-kilt handler
run: |
make -C runtimes/cloudformation clean cmd/handler/handler
33 changes: 0 additions & 33 deletions .github/workflows/release-runtimes.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release agent-kilt

on:
push:
tags:
- 'v*'

env:
GO_VERSION: 1.20.x

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build agent-kilt handler
run: |
make -C runtimes/cloudformation clean cmd/handler/handler
- name: Archive build
run: |
zip -j agent-kilt.zip runtimes/cloudformation/cmd/handler/handler
sha256sum agent-kilt.zip > checksums.txt
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
agent-kilt.zip
checksums.txt
tag_name: ${{ github.ref }}
31 changes: 0 additions & 31 deletions .goreleaser.yml

This file was deleted.

5 changes: 4 additions & 1 deletion runtimes/cloudformation/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
GOOS?=linux
GOARCH?= amd64

agent-kilt.zip: cmd/handler/handler
cd cmd/handler/ && zip ../../agent-kilt.zip ./handler

cmd/handler/handler:
cd cmd/handler && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build .
cd cmd/handler && CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build .

clean:
rm agent-kilt.zip || true
Expand Down

0 comments on commit b1660bd

Please sign in to comment.