Browse Source

Update go-ossf-slsa3-publish.yml

master
yuriy0803 2 years ago committed by GitHub
parent
commit
9ad52def9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 72
      .github/workflows/go-ossf-slsa3-publish.yml

72
.github/workflows/go-ossf-slsa3-publish.yml

@ -1,43 +1,57 @@
name: SLSA Go Releaser # This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow lets you compile your Go project using a SLSA3 compliant builder.
# This workflow will generate a so-called "provenance" file describing the steps
# that were performed to generate the final binary.
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.
name: SLSA Go releaser
on: on:
workflow_dispatch:
release: release:
types: types: [created]
- created
jobs:
build_windows:
runs-on: windows-latest
steps: permissions: read-all
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Go jobs:
uses: actions/setup-go@v2 # ========================================================================================================================================
with: # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project.
go-version: 1.19 # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file
#=========================================================================================================================================
- name: Run SLSA Go Generator (Windows) build:
uses: slsa-framework/slsa-github-generator@v1.4.0 permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0
with: with:
go-version: 1.19 go-version: 1.17
# add any other necessary configuration here # =============================================================================================================
# Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects
# =============================================================================================================
build_linux: publish:
needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Go - name: Install Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.19 go-version: 1.19
- name: Run SLSA Go Generator (Linux) - name: Install GoReleaser
uses: slsa-framework/slsa-github-generator@v1.4.0 run: |
with: curl -sfL https://install.goreleaser.com/install-goreleaser.sh | sh
go-version: 1.19
# add any other necessary configuration here - name: Release
run: |
goreleaser --config .goreleaser.yml

Loading…
Cancel
Save