mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00:00
5032f998a0
* Generate SBOM * Update release.yml * Update .github/workflows/release.yml Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com> * Publish bom.json * Ignore SBOMs generated during CI Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO111MODULE: on
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@v2
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
- name : Get release version
|
|
id: get_version
|
|
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
|
|
- name: Generate SBOM
|
|
uses: CycloneDX/gh-gomod-generate-sbom@v0.2.0
|
|
with:
|
|
json: true
|
|
output: bom.json
|
|
resolve-licenses: true
|
|
version: latest
|
|
- name: Release Binaries
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
version: latest
|
|
args: release --rm-dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Release Docker Image
|
|
uses: elgohr/Publish-Docker-Github-Action@master
|
|
with:
|
|
name: securego/gosec
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
buildargs: GO_VERSION=1.16
|
|
tags: "latest,${{ env.RELEASE_VERSION }}"
|
|
tag_names: true
|