Skip to content

primazactl-release

primazactl-release #60

Workflow file for this run

name: Release primazactl
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: "create a version for primazctl"
required: true
default: "latest"
organization:
description: "git organization from which to get the primaza release"
required: true
default: "primaza"
repository_dispatch:
types: [primazactl-release]
permissions:
contents: write
jobs:
build:
name: Deploy releases for Linux
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: "x64"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "^1.20"
- name: Checkout code
uses: actions/checkout@v3
- name: Set Version and Draft release
run: |
# set version based on dispatch type
draft_release="true"
if [[ "${{github.event_name}}" == "workflow_dispatch" ]]; then
version=${{ github.event.inputs.version }}
draft_release="false"
echo "GIT_ORG=${{ github.event.inputs.organization }}" >> $GITHUB_ENV
elif [[ "${{github.ref_type}}" == "tag" ]]; then
version=${{ github.ref_name }}
elif [[ "${{github.event_name}}" == "repository_dispatch" ]]; then
version=${{ github.event.client_payload.version }}
draft_release="false"
echo "GIT_ORG=${{ github.event.client_payload.organization }}" >> $GITHUB_ENV
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "DRAFT_RELEASE=$draft_release" >> $GITHUB_ENV
- name: Test and make manifests
id: test-and-manifests
run: |
# run make test-local to test and create manifests
make test-local
- name: Build binary
run: make single-binary
- name: Delete previous release and tag
if: ${{ env.VERSION == 'latest' || env.VERSION == 'nightly' }}
uses: dev-drprasad/[email protected]
with:
delete_release: true # default: false
tag_name: ${{ env.VERSION }} # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release for tag event
if: ${{ github.ref_type == 'tag' }}
uses: softprops/action-gh-release@v1
with:
body: "Release version ${{ env.VERSION }}"
draft: true
generate_release_notes: true
files: |
./out/venv3/dist/primazactl
- name: Release for non tag events
if: ${{ github.ref_type != 'tag' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
body: "Release version ${{ env.VERSION }}"
draft: ${{ env.DRAFT_RELEASE }}
generate_release_notes: true
files: |
./out/venv3/dist/primazactl