Skip to content

Release Stable Pull Request #16

Release Stable Pull Request

Release Stable Pull Request #16

name: Release Stable Pull Request
on:
# Allows you to run this workflow manually
workflow_dispatch:
inputs:
ocrd-all-version:
description: Stable tag of ocrd/all from stage for OCR-D Controller
required: true
ocrd-core-version:
description: Stable tag of ocrd/core from stage for OCR-D Manager
required: true
jobs:
build-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules of stable branch
uses: actions/checkout@v3
with:
ref: stable
submodules: recursive
fetch-depth: 0 # fetch tags
- name: Generate environment variables
run: |
date +"release_version=v%Y%m%d-stable" >> $GITHUB_ENV
date +"release_date=%Y%m%d" >> $GITHUB_ENV
- name: Changes to provide release
run: |
# Update CHANGELOG.md
./.github/scripts/update-changelog.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.release_version }}
# Update .env
sed -i 's|CONTROLLER_BASE_VERSION=maximum-cuda|CONTROLLER_BASE_VERSION=${{ github.event.inputs.ocrd-all-version }}|g' .env
sed -i 's|CONTROLLER_IMAGE=ghcr.io/slub/ocrd_controller:latest|CONTROLLER_IMAGE=ghcr.io/slub/ocrd_controller:stable|g' .env
sed -i 's|MANAGER_BASE_VERSION=latest|MANAGER_BASE_VERSION=${{ github.event.inputs.ocrd-core-version }}|g' .env
sed -i 's|MANAGER_IMAGE=ghcr.io/slub/ocrd_manager:latest|MANAGER_IMAGE=ghcr.io/slub/ocrd_manager:stable|g' .env
sed -i 's|MONITOR_IMAGE=ghcr.io/slub/ocrd_monitor:latest|MONITOR_IMAGE=ghcr.io/slub/ocrd_monitor:stable|g' .env
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: changes-for-release
title: Release stable version ${{ env.release_version }}
body: |
## Autogenerated changes
- Update CHANGELOG.md
- Update .env
- Replace `CONTROLLER_BASE_VERSION` with `${{ github.event.inputs.ocrd-all-version }}`
- Replace `MANAGER_BASE_VERSION` with `${{ github.event.inputs.ocrd-core-version }}`
- Replace `latest` with `stable`
## Manual steps to provide new release ${{ env.release_version }}
- Navigate to https://github.com/slub/ocrd_kitodo/releases/new after PR is merged
- Choose a tag "${{ env.release_version }}" and create this as new tag
- Choose target "stable"
- Release title "Stable Version "${{ env.release_date }}" of the integration of OCR-D and Kitodo.Production"
- Copy changes of release from CHANGELOG.md to description
base: stable
branch: release-stable-version-${{ env.release_version }}
delete-branch: true