Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/Changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Changelog

on: pull_request

jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog should be updated
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Git fetch
run: git fetch

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
39 changes: 39 additions & 0 deletions .github/workflows/Version_Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check pyproject.toml Version Change

on:
pull_request:
branches:
- 'main'

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get current version in PR branch
id: get-pr-version
run: |
PR_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV

- name: Get version in base branch
id: get-base-version
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git checkout FETCH_HEAD
BASE_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV

- name: Compare versions
run: |
echo "PR version: ${{ env.PR_VERSION }}"
echo "Base branch version: ${{ env.BASE_VERSION }}"

if [ "${{ env.PR_VERSION }}" == "${{ env.BASE_VERSION }}" ]; then
echo "Version number has not been changed."
exit 1
else
echo "Version number has changed."
fi
Comment thread
ghbm-itk marked this conversation as resolved.
File renamed without changes.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Changelog!
- PR workflows.
- Version number in UI.

## [0.0.1]

- Initial release

[Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.0.1...HEAD
[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.0.1
3 changes: 3 additions & 0 deletions src/OpenPostbud/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import logging
import json
from importlib import metadata

import dotenv

Expand Down Expand Up @@ -49,6 +50,8 @@ def format(self, record: logging.LogRecord):
SHIPMENT_LIFETIME_DAYS = int(os.environ['shipment_lifetime_days'])
REGISTRATION_JOB_LIFETIME_DAYS = int(os.environ['registration_job_lifetime_days'])

OPENPOSTBUD_VERSION = metadata.version("OpenPostbud")

# Workers
CVR = os.environ['cvr']
KOMBIT_CERT_PATH = os.environ['kombit_cert_path']
Expand Down
3 changes: 3 additions & 0 deletions src/OpenPostbud/ui_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from nicegui import ui, app

from OpenPostbud.middleware import authentication
from OpenPostbud import config


def header():
Expand All @@ -32,6 +33,8 @@ def header():
ui.space()
ui.label(authentication.get_current_user()).classes('text-lg text-white')
ui.label(str(authentication.get_current_user_roles())).classes('text-lg text-white')
ui.separator().props("vertical color=white size=2px")
ui.label(config.OPENPOSTBUD_VERSION).classes('text-lg text-white')
ui.button("Log Ud", on_click=authentication.logout, color="white").classes("text-primary")


Expand Down
Loading