Skip to content

Merge pull request #9 from Avi-Robusta/working_version #2

Merge pull request #9 from Avi-Robusta/working_version

Merge pull request #9 from Avi-Robusta/working_version #2

Workflow file for this run

# This workflow is triggered on new tags.
# It runs tests to validate that the code is working before publishing a new
# version for plugin "lineage" in krew-index.
name: release
on:
push:
tags:
- 'v*.*.*'
env:
GO_VERSION: "1.22.4"
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build binary
run: CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage ./cmd/kube-lineage
- name: Upload binary to release
uses: actions/upload-artifact@v3
with:
name: kube-lineage
path: kube-lineage
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kube-lineage
asset_name: kube-lineage
asset_content_type: application/octet-stream