Skip to content

v0.0.2-stacker

v0.0.2-stacker #3

Workflow file for this run

name: build/test
on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22"]
os: ["linux"]
arch: ["amd64"]
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/[email protected]
id: short-sha
- name: Set up golang ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: build
run: |
make binary OS=${{ matrix.os }} ARCH=${{ matrix.arch }}
- name: lint
run: |
make lint
- name: Upload code coverage
uses: codecov/codecov-action@v3
- uses: actions/cache/save@v3
if: always()
with:
file: bin/bom-*
key: ${{ github.sha }}
release:
if: github.event_name == 'release' && github.event.action== 'published'
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22"]
os: ["linux"]
arch: ["amd64"]
steps:
- uses: actions/checkout@v3
- name: Set up golang ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: build
run: |
make binary RELEASE_TAG=${{ github.event.release.tag_name }} OS=${{ matrix.os }} ARCH=${{ matrix.arch }}
- uses: actions/cache/save@v3
if: always()
with:
path: bin/sbom
key: ${{ github.ref }}
- name: Publish artifacts on releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/bom-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true