Skip to content

Merge pull request #150 from puerco/generate #7

Merge pull request #150 from puerco/generate

Merge pull request #150 from puerco/generate #7

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v3.3.0
with:
go-version: '1.21'
check-latest: true
- name: Install cosign
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0
- name: Install bom
uses: kubernetes-sigs/release-actions/setup-bom@dd08496c83441d6477114cc0555b96d404dacff7 # v0.1.2
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
- 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@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@dd08496c83441d6477114cc0555b96d404dacff7 # v0.1.2
- run: |
tejolote attest --artifacts github://openvex/vexctl/${{ steps.tag.outputs.tag_name }} github://openvex/vexctl/"${GITHUB_RUN_ID}" --output vexctl.intoto.json --sign
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: vexctl.intoto.json
tag_name: "${{ steps.tag.outputs.tag_name }}"
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_REPOSITORY: openvex/vexctl