forked from primaza/primazactl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
365 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,12 @@ on: | |
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 | ||
|
@@ -26,24 +32,31 @@ jobs: | |
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 Manifests | ||
- name: Set Version and Draft release | ||
run: | | ||
# set version based on dispatch type | ||
version="latest" | ||
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 "PRIMAZA_CTL_VERSION=$version" >> $GITHUB_ENV | ||
echo "PRIMAZA_CONFIG_FILE=primaza_main_config_$version.yaml" >> $GITHUB_ENV | ||
echo "WORKER_CONFIG_FILE=primaza_worker_config_$version.yaml" >> $GITHUB_ENV | ||
echo "APPLICATION_AGENT_CONFIG_FILE=application_agent_config_$version.yaml" >> $GITHUB_ENV | ||
echo "SERVICE_AGENT_CONFIG_FILE=service_agent_config_$version.yaml" >> $GITHUB_ENV | ||
echo "DRAFT_RELEASE=$draft_release" >> $GITHUB_ENV | ||
- name: Test and make manifests | ||
id: test-and-manifests | ||
|
@@ -55,15 +68,14 @@ jobs: | |
run: make single-binary | ||
|
||
- name: Delete previous release and tag | ||
if: ${{ env.VERSION == 'latest' }} | ||
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 | ||
|
@@ -73,22 +85,14 @@ jobs: | |
generate_release_notes: true | ||
files: | | ||
./out/venv3/dist/primazactl | ||
${{ env.PRIMAZA_CONFIG_FILE }} | ||
${{ env.WORKER_CONFIG_FILE }} | ||
${{ env.APPLICATION_AGENT_CONFIG_FILE }} | ||
${{ env.SERVICE_AGENT_CONFIG_FILE }} | ||
- 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: true | ||
draft: ${{ env.DRAFT_RELEASE }} | ||
generate_release_notes: true | ||
files: | | ||
./out/venv3/dist/primazactl | ||
${{ env.PRIMAZA_CONFIG_FILE }} | ||
${{ env.WORKER_CONFIG_FILE }} | ||
${{ env.APPLICATION_AGENT_CONFIG_FILE }} | ||
${{ env.SERVICE_AGENT_CONFIG_FILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
PRIMAZA_CONFIG: str = "primaza_main_config" | ||
WORKER_CONFIG: str = "primaza_worker_config" | ||
APP_AGENT_CONFIG: str = "application_agent_config" | ||
SVC_AGENT_CONFIG: str = "service_agent_config" | ||
REPOSITORY: str = "primaza/primazactl" | ||
import os | ||
|
||
PRIMAZA_CONFIG: str = "control_plane_config" | ||
WORKER_CONFIG: str = "crds_config" | ||
APP_AGENT_CONFIG: str = "application_namespace_config" | ||
SVC_AGENT_CONFIG: str = "service_namespace_config" | ||
REPOSITORY: str = "primaza/primaza" | ||
TEST_REPOSITORY_OVERRIDE: str = "primaza-test-only-repository-override" | ||
|
||
|
||
def get_repository(): | ||
override_repo = os.getenv(TEST_REPOSITORY_OVERRIDE) | ||
if override_repo: | ||
return override_repo | ||
return REPOSITORY |
Oops, something went wrong.