2020-04-09 12:01:40 +01:00
|
|
|
name: Release
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GO111MODULE: on
|
2021-01-22 10:36:52 +00:00
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
2020-04-09 12:01:40 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout Source
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
- name: Set up Go
|
2020-11-02 08:15:56 +00:00
|
|
|
uses: actions/setup-go@v2
|
2020-04-09 12:01:40 +01:00
|
|
|
with:
|
2021-02-26 10:12:38 +00:00
|
|
|
go-version: 1.16.x
|
2020-04-09 12:01:40 +01:00
|
|
|
- name : Get release version
|
|
|
|
id: get_version
|
|
|
|
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
|
2021-06-21 09:50:44 +01:00
|
|
|
- name: Generate SBOM
|
|
|
|
uses: CycloneDX/gh-gomod-generate-sbom@v0.2.0
|
|
|
|
with:
|
|
|
|
json: true
|
|
|
|
output: bom.json
|
|
|
|
resolve-licenses: true
|
|
|
|
version: latest
|
2020-04-09 12:01:40 +01:00
|
|
|
- name: Release Binaries
|
2020-11-02 08:15:56 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v2
|
2020-04-09 12:01:40 +01:00
|
|
|
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 }}
|
2021-02-26 10:12:38 +00:00
|
|
|
buildargs: GO_VERSION=1.16
|
2020-04-09 12:01:40 +01:00
|
|
|
tags: "latest,${{ env.RELEASE_VERSION }}"
|
|
|
|
tag_names: true
|