Skip to content

Commit

Permalink
Feature/mx1551 GitHub release pipeline (#20)
Browse files Browse the repository at this point in the history
# PR Context
<!-- Additional info for the reviewer -->

# Added
<!-- New features and interfaces -->

- pdm release plugin as additional requirement for template packages
- github action for releasing a new version in template packages
  • Loading branch information
rababerladuseladim authored May 28, 2024
1 parent 1306a62 commit 30464dd
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- configure renovatebot for mex-template itself
- pdm release plugin as additional requirement for template packages
- github action for releasing a new version in template packages

### Changes

Expand Down
62 changes: 62 additions & 0 deletions mex-{{ cookiecutter.project_name }}/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

run-name: release version {% raw %}${{ inputs.version }} by @${{ github.actor }}{% endraw %}

on:
workflow_dispatch:
branches: ["main"]
inputs:
version:
type: choice
description: 'part of the project version to update'
options:
- major
- minor
- patch
required: true

env:
PIP_NO_OPTION: on
PIP_NO_CLEAN: on
PIP_PREFER_BINARY: on

permissions:
contents: write

concurrency:
group: "release"
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Cache requirements
uses: actions/cache@v4
env:
cache-name: cache-requirements
with:
path: ~/.cache/pip
{% raw %}key: ${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}{% endraw %}
restore-keys: |
{% raw %}${{ env.cache-name }}-{% endraw %}
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install requirements
run: make setup

- name: Release new version
run: |
git config --global user.name 'RKIMetadataExchange'
git config --global user.email '[email protected]'
pdm release {% raw %}${{ inputs.version }}{% endraw %}
6 changes: 2 additions & 4 deletions mex-{{ cookiecutter.project_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ components of the MEx project are open-sourced under the same license as well.

### creating release

- update version in `pyproject.toml` and `CHANGELOG.md`
- commit update `git commit --message "..."`
- create a tag `git tag ...`
- push `git push --follow-tags`
- run `pdm release RULE` to release a new version where RULE determines which part of
the version to update and is one of `major`, `minor`, `patch`.

### container workflow

Expand Down
1 change: 1 addition & 0 deletions mex-{{ cookiecutter.project_name }}/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cruft==2.15.0
mex-release @ git+https://github.com/robert-koch-institut/mex-release.git
pdm==2.15.3
pre-commit==3.7.1
wheel==0.43.0

0 comments on commit 30464dd

Please sign in to comment.