mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-08-20 04:46:53 +00:00
100 lines
2.7 KiB
YAML
100 lines
2.7 KiB
YAML
on:
|
|
push:
|
|
# Sequence of patterns matched against refs/tags
|
|
tags:
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
|
|
name: Release
|
|
|
|
concurrency:
|
|
group: kubeshark-publish-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
cli:
|
|
name: Build the CLI and publish
|
|
runs-on: ubuntu-latest
|
|
needs: [docker-manifest]
|
|
steps:
|
|
- name: Set up Go 1.17
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '1.17'
|
|
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v2
|
|
|
|
- id: 'auth'
|
|
uses: 'google-github-actions/auth@v0'
|
|
with:
|
|
credentials_json: '${{ secrets.GCR_JSON_KEY }}'
|
|
|
|
- name: 'Set up Cloud SDK'
|
|
uses: 'google-github-actions/setup-gcloud@v0'
|
|
|
|
- name: Determine versioning strategy
|
|
uses: haya14busa/action-cond@v1
|
|
id: condval
|
|
with:
|
|
cond: ${{ github.ref == 'refs/heads/main' }}
|
|
if_true: "stable"
|
|
if_false: "dev"
|
|
|
|
- name: Auto Increment Ver Action
|
|
uses: docker://igorgov/auto-inc-ver:v2.0.0
|
|
id: versioning
|
|
with:
|
|
mode: ${{ steps.condval.outputs.value }}
|
|
suffix: 'dev'
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Get version parameters
|
|
shell: bash
|
|
run: |
|
|
echo "##[set-output name=build_timestamp;]$(echo $(date +%s))"
|
|
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
id: version_parameters
|
|
|
|
- name: Build and Push CLI
|
|
run: make push-cli VER='${{ steps.versioning.outputs.version }}' BUILD_TIMESTAMP='${{ steps.version_parameters.outputs.build_timestamp }}'
|
|
|
|
- name: Log the version into a .txt file
|
|
shell: bash
|
|
run: |
|
|
echo '${{ steps.versioning.outputs.version }}' >> cli/bin/version.txt
|
|
|
|
- name: Release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
artifacts: "cli/bin/*"
|
|
commit: ${{ steps.version_parameters.outputs.branch }}
|
|
tag: ${{ steps.versioning.outputs.version }}
|
|
prerelease: ${{ github.ref != 'refs/heads/main' }}
|
|
bodyFile: 'cli/bin/README.md'
|
|
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Fetch all tags
|
|
run: git fetch --force --tags
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
distribution: goreleaser
|
|
version: ${{ env.GITHUB_REF_NAME }}
|
|
args: release --rm-dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
|