Skip to content

Stage Release

Stage Release #3

Workflow file for this run

---
name: Stage Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to stage'
required: true
default_eda_version:
description: 'Will be injected as the DEFAULT_EDA_VERSION build arg.'
required: true
default_eda_ui_version:
description: 'Will be injected as the DEFAULT_EDA_UI_VERSION build arg.'
required: true
confirm:
description: 'Are you sure? Set this to yes.'
required: true
default: 'no'
jobs:
stage:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Verify inputs
run: |
set -e
if [[ ${{ github.event.inputs.confirm }} != "yes" ]]; then
>&2 echo "Confirm must be 'yes'"
exit 1
fi
if [[ ${{ github.event.inputs.version }} == "" ]]; then
>&2 echo "Set version to continue."
exit 1
fi
exit 0
- name: Checkout eda-server-operator
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/eda-server-operator
path: eda-server-operator
- name: Install playbook dependencies
run: |
python3 -m pip install docker
- name: Log into registry ghcr.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Operator Image
run: |
BUILD_ARGS="--build-arg DEFAULT_EDA_VERSION=${{ github.event.inputs.default_eda_version }} \
--build-arg DEFAULT_EDA_UI_VERSION=${{ github.event.inputs.default_eda_ui_version }} \
--build-arg OPERATOR_VERSION=${{ github.event.inputs.version }}" \
IMG=ghcr.io/${{ github.repository }}:${{ github.event.inputs.version }} \
make docker-buildx
working-directory: eda-server-operator
# Stub task for later PR to add EDA CI run
# - name: Run test deployment
# working-directory: eda-server-operator
# run: |
# python3 -m pip install -r molecule/requirements.txt
# ansible-galaxy collection install -r molecule/requirements.yml
# sudo rm -f $(which kustomize)
# make kustomize
# KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind
# env:
# EDA_TEST_VERSION: ${{ github.event.inputs.default_eda_version }}
- name: Generate operator.yaml
run: make generate-operator-yaml VERSION=${{ github.event.inputs.version }}
working-directory: eda-server-operator
- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: true
- name: Upload Release Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./eda-server-operator/operator.yaml
asset_name: operator.yaml
asset_content_type: application/yaml