Skip to content

Release Images

Release Images #1154

Workflow file for this run

name: Release Images
on:
pull_request_review:
types: [submitted]
workflow_dispatch:
jobs:
release-images:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.title, 'Release MongoDB Kubernetes Operator') && github.event.review.state == 'approved'
strategy:
matrix:
include:
- pipeline-argument: operator
release-key: operator
- pipeline-argument: version-upgrade-hook
release-key: version-upgrade-hook
- pipeline-argument: readiness-probe
release-key: readiness-probe
- pipeline-argument: agent
release-key: agent
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10.4'
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Determine if release is needed
id: release_status
run: |
OUTPUT=$(scripts/ci/determine_required_releases.py ${{ matrix.release-key }})
echo "::set-output name=OUTPUT::$OUTPUT"
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
# template: .action_templates/steps/set-up-qemu.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Publish Image To Quay
if: steps.release_status.outputs.OUTPUT == 'unreleased'
run: python pipeline.py --image-name ${{ matrix.pipeline-argument }} --release
env:
MONGODB_COMMUNITY_CONFIG: "${{ github.workspace }}/scripts/ci/config.json"
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
create-draft-release:
runs-on: ubuntu-latest
needs: [release-images]
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Determine Release Tag
id: release_tag
run: |
OUTPUT=$(jq -r '."mongodb-kubernetes-operator"' < $GITHUB_WORKSPACE/release.json)
echo "::set-output name=OUTPUT::$OUTPUT"
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.release_tag.outputs.OUTPUT }}"
name: MongoDB Kubernetes Operator
bodyFile: "${{ github.workspace }}/docs/RELEASE_NOTES.md"
draft: true
token: ${{ secrets.GITHUB_TOKEN }}