fix(kc-scheduler): add missing customCommand in gluu-aio (#1877) #1411
Workflow file for this run
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
name: upload-release | |
# This builds, packages and releases pygluu-kubernetes | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
nightly: | |
description: 'Enable nightly build' | |
default: "false" | |
required: false | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
publish: | |
name: Publish for ${{ matrix.asset_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
# flex linux setup | |
- os: ubuntu-latest | |
artifact_name: flex-linux-setup.pyz | |
asset_name: flex-linux-setup-ubuntu-amd64.pyz | |
asset_directory: flex-linux-setup | |
python_version: 3.8 | |
# flex linux setup on CentOS8 | |
- os: ubuntu-latest | |
artifact_name: flex-linux-setup.pyz | |
asset_name: flex-linux-setup-centos-amd64.pyz | |
asset_directory: flex-linux-setup | |
python_version: 3.8 | |
# helm chart | |
- os: ubuntu-latest | |
artifact_name: helm # Will be changed automatically | |
asset_name: helm # Will be changed automatically | |
asset_directory: charts/gluu | |
python_version: 3.8 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Build Helm Package | |
if: matrix.asset_name == 'helm' | |
run: | | |
cd ${{ matrix.asset_directory }} | |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | |
chmod 700 get_helm.sh | |
./get_helm.sh | |
helm package . | |
ASSET_NAME=$(ls ${{github.workspace}}/${{ matrix.asset_directory }} | grep ".tgz" | grep -Ev "sha256sum" | sort -rn | head -1) | |
sha256sum ${ASSET_NAME} > ${ASSET_NAME}.sha256sum | |
- name: Map outputs | |
id: output | |
run: | | |
if [[ "${{ matrix.asset_name }}" == "helm" ]]; then | |
ASSET_NAME=$(ls ${{github.workspace}}/${{ matrix.asset_directory }} | grep ".tgz" | grep -Ev "sha256sum" | sort -rn | head -1) | |
echo "Modifying helm asset name to ${ASSET_NAME}" | |
echo "artifact_name=${ASSET_NAME}" >> $GITHUB_OUTPUT | |
echo "asset_name=${ASSET_NAME}" >> $GITHUB_OUTPUT | |
else | |
echo "artifact_name=${{ matrix.artifact_name }}" >> $GITHUB_OUTPUT | |
echo "asset_name=${{ matrix.asset_name }}" >> $GITHUB_OUTPUT | |
fi | |
echo "tag=$(curl https://api.github.com/repos/${{ github.repository }}/releases -s | grep "tag_name" | cut -d '"' -f 4 | grep -o '^\v.*' | head -n 1)" >> $GITHUB_OUTPUT | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install jq | |
- name: Lint with flake8 | |
run: | | |
pip3 install flake8 | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Build Zipapp | |
if: matrix.asset_name != 'flex-linux-setup-centos8-amd64.pyz' && matrix.asset_name != 'helm' | |
run: | | |
sudo apt-get update || brew install jq | |
sudo apt-get install build-essential || echo "Maybe im on macos OS" | |
pip3 install shiv | |
cd ${{ matrix.asset_directory }} | |
make zipapp | |
sha256sum ${{ steps.output.outputs.artifact_name }} > ${{ steps.output.outputs.artifact_name }}.sha256sum | |
ls | |
- uses: addnab/docker-run-action@v3 | |
if: matrix.asset_name == 'flex-linux-setup-centos8-amd64.pyz' | |
name: Build with CentOS8 | |
continue-on-error: true | |
with: | |
image: centos/python-36-centos7:latest | |
options: -v ${{ github.workspace }}:/centos | |
run: | | |
echo "Building flex-linux-setup package" | |
cd /centos/flex-linux-setup | |
pip install shiv | |
make zipapp | |
sha256sum ${{ steps.output.outputs.artifact_name }} > ${{ steps.output.outputs.artifact_name }}.sha256sum | |
ls | |
- name: Get latest tag | |
id: previoustag | |
run: | | |
echo "tag=$(curl https://api.github.com/repos/${{ github.repository }}/releases -s | grep "tag_name" | cut -d '"' -f 4 | grep -o '^\v.*' | head -n 1)" >> $GITHUB_OUTPUT | |
- name: Print outputs | |
run: | | |
echo "ASSETNAME=${{ steps.output.outputs.asset_name }}" >> ${GITHUB_ENV} | |
#If on schedule build nightly packages | |
if [ ${{ github.event_name }} = "schedule" ] || [ ${{ github.event.inputs.nightly }} = true ]; then | |
echo "Activating nightly build" | |
echo "ASSETNAME=nightly-build-${{ steps.output.outputs.asset_name }}" >> ${GITHUB_ENV} | |
fi | |
echo "${{ steps.previoustag.outputs.tag }}" | |
echo "$ASSETNAME" | |
echo "${{ steps.output.outputs.artifact_name }}" | |
- name: Upload binaries to release | |
continue-on-error: true | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.MOWORKFLOWTOKEN }} | |
file: ${{github.workspace}}/${{ matrix.asset_directory }}/${{ steps.output.outputs.artifact_name }} | |
asset_name: ${{ env.ASSETNAME }} | |
tag: ${{ steps.previoustag.outputs.tag }} | |
overwrite: true | |
- name: Upload shas to release | |
continue-on-error: true | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.MOWORKFLOWTOKEN }} | |
file: ${{github.workspace}}/${{ matrix.asset_directory }}/${{ steps.output.outputs.artifact_name }}.sha256sum | |
asset_name: ${{ env.ASSETNAME }}.sha256sum | |
tag: ${{ steps.previoustag.outputs.tag }} | |
overwrite: true |