build: updated to version 0.10.0 #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#==============================================================================# | |
# Author: Dominik Müller # | |
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, # | |
# University of Augsburg # | |
# # | |
# This program is free software: you can redistribute it and/or modify # | |
# it under the terms of the GNU General Public License as published by # | |
# the Free Software Foundation, either version 3 of the License, or # | |
# (at your option) any later version. # | |
# # | |
# This program is distributed in the hope that it will be useful, # | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
# GNU General Public License for more details. # | |
# # | |
# You should have received a copy of the GNU General Public License # | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
#==============================================================================# | |
# This workflow will: | |
# - create a CHANGELOG between latest tag and current tag | |
# - release the package on GitHub | |
# - dockerize the package on GitHub (GitHub Container Registry) | |
# - upload it to PyPI | |
name: Package Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
release: | |
name: Release on GitHub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Create CHANGELOG | |
id: changelog | |
uses: Requarks/changelog-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
excludeTypes: other,style | |
- name: Create Release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: aucmedi_${{ github.ref }} | |
body: ${{ steps.changelog.outputs.changes }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
dockerize: | |
name: Dockerize on GitHub | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
- name: Build wheel and source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish distribution | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |