Skip to content

Commit

Permalink
Merge pull request #1 from interlynk-io/feature/goreleaser
Browse files Browse the repository at this point in the history
go releaser workflow
  • Loading branch information
riteshnoronha authored May 3, 2023
2 parents 958c7a5 + 144c4a8 commit aeb6c26
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: releaser

on:
push:
tags:
- 'v*'

jobs:
releaser:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.20'
check-latest: true
cache: true
- name: Download syft binary
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Run syft
run: syft version
- name: Goreleaser
uses: goreleaser/goreleaser-action@v4
with:
install-only: true
- run: go version
- run: goreleaser -v
- name: Releaser
run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
project_name: sbomasm

env:
- GO111MODULE=on

before:
hooks:
- go mod tidy
- /bin/bash -c 'if [ -n "$(git --no-pager diff --exit-code go.mod go.sum)" ]; then exit 1; fi'

gomod:
proxy: true

builds:
- id: binaries
binary: sbomasm-{{ .Os }}-{{ .Arch }}
no_unique_dist_dir: true
main: .
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- "{{ .Env.LDFLAGS }}"
env:
- CGO_ENABLED=0

archives:
- format: binary
name_template: "{{ .Binary }}"
allow_different_binary_count: true

snapshot:
name_template: SNAPSHOT-{{ .ShortCommit }}

release:
prerelease: allow
draft: true

sboms:
-
artifacts: binary
documents:
- "${artifact}.spdx.sbom"

0 comments on commit aeb6c26

Please sign in to comment.