Skip to content

release

release #154

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
workflow_dispatch: {}
permissions:
contents: read
jobs:
artifacts:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
steps:
# --------------------------------------------------------------------------
# Repository Checkout
# --------------------------------------------------------------------------
- name: checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: setup golang
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
# --------------------------------------------------------------------------
# Build & Upload Artifacts
# --------------------------------------------------------------------------
- name: build for ${{ matrix.os }} ${{ matrix.arch }}
run: make build GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
- name: upload ${{ matrix.os }} ${{ matrix.arch }} artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: bin-${{ matrix.os }}-${{ matrix.arch }}
path: build/ktf.${{ matrix.os }}.${{ matrix.arch }}
if-no-files-found: error
# --------------------------------------------------------------------------
# Generate Checksums
# --------------------------------------------------------------------------
- name: generate checksum for ${{ matrix.os }} ${{ matrix.arch }} artifact
run: sha256sum ktf.${{ matrix.os }}.${{ matrix.arch }} >> CHECKSUMS.${{ matrix.os }}.${{ matrix.arch }}
working-directory: ./build/
- name: upload checksum for ${{ matrix.os }} ${{ matrix.arch }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: CHECKSUMS-${{ matrix.os }}-${{ matrix.arch }}
path: build/CHECKSUMS.${{ matrix.os }}.${{ matrix.arch }}
if-no-files-found: error
# --------------------------------------------------------------------------
# Release Job
# --------------------------------------------------------------------------
release:
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- artifacts
steps:
# --------------------------------------------------------------------------
# Github Release
# --------------------------------------------------------------------------
- name: download checksums artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: CHECKSUMS*
merge-multiple: true
- name: concatenate all checksums
run: cat CHECKSUMS.* > CHECKSUMS
- name: download binary artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: bin*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
draft: false
prerelease: false
files: |
CHECKSUMS
ktf.*
body: |
See the [CHANGELOG.md](https://raw.githubusercontent.com/Kong/kubernetes-testing-framework/main/CHANGELOG.md)
env:
GITHUB_TOKEN: ${{ github.token }}