Skip to content

Commit

Permalink
ci: build binaries using goreleaser
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Shirvankar <[email protected]>
  • Loading branch information
h0lyalg0rithm authored and glimchb committed Aug 1, 2024
1 parent 0c75756 commit b8503d0
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: binaries

on:
workflow_call:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.19'
cache-dependency-path: sztp-agent/go.sum

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ on:

jobs:
release-docker:
uses: ./.github/workflows/sztp.yml
uses: ./.github/workflows/sztp.yaml
secrets: inherit
release-binaries:
uses: ./.github/workflows/binaries.yaml
secrets: inherit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
25 changes: 25 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

gomod:
dir: ./sztp-agent/

builds:
- dir: ./sztp-agent/
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64

changelog:
sort: asc

0 comments on commit b8503d0

Please sign in to comment.