Skip to content

Merge pull request #243 from openvex/dependabot/go_modules/all-37b387… #8

Merge pull request #243 from openvex/dependabot/go_modules/all-37b387…

Merge pull request #243 from openvex/dependabot/go_modules/all-37b387… #8

Workflow file for this run

# Copyright 2023 The OpenVEX Authors
# SPDX-License-Identifier: Apache-2.0
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for pushing the images to ghcr.io
env:
COSIGN_YES: "true"
steps:
- name: Check out code onto GOPATH
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v3.3.0
with:
go-version: '1.22'
check-latest: true
- name: Install cosign
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
- name: Install bom
uses: kubernetes-sigs/release-actions/setup-bom@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0
- uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7
- name: Set LDFLAGS
id: ldflags
run: |
source ./release/ldflags.sh
goflags=$(ldflags)
echo "GO_FLAGS="${goflags}"" >> "$GITHUB_ENV"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LDFLAGS: ${{ env.GO_FLAGS }}
- name: Log into ghcr.io
run: echo ${{ secrets.GITHUB_TOKEN }} | ko login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: build images
run: make build-sign-release-images || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
attestation:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
needs:
- release
steps:
- name: Check out code onto GOPATH
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 1
- name: Set tag output
id: tag
run: echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
- name: Install tejolote
uses: kubernetes-sigs/release-actions/setup-tejolote@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0
- run: |
tejolote attest --artifacts github://openvex/vexctl/${{ steps.tag.outputs.tag_name }} github://openvex/vexctl/"${GITHUB_RUN_ID}" --output vexctl.intoto.json --sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
files: vexctl.intoto.json
tag_name: "${{ steps.tag.outputs.tag_name }}"
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_REPOSITORY: openvex/vexctl