Skip to content

fix version file

fix version file #12

Workflow file for this run

name: Release on Tag
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: python -m pip install --upgrade pip && pip install tox build
- name: Get Version
id: get-version
run: python dev/get_version.py
- name: Ensure tag matches version
if: github.ref_name != steps.get-version.outputs.APP_VERSION
run: |
echo "ERROR: tag name (${{ github.ref_name }}) does not match current version in version.py (${{ steps.get-version.outputs.APP_VERSION }})"
exit 2
- name: Convert CHANGES to markdown
uses: docker://pandoc/core:2.19
with:
args: -f rst -t markdown --wrap=none --markdown-headings=atx --output=CHANGES.md CHANGES.rst
- name: Generate release changelog
run: python dev/get_changelog.py
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build
id: docker-build
env:
TEST_DOCKER: "false"
run: |
tox -e docker
- name: Echo Docker Image
run: |
echo ${{ steps.docker-build.outputs.DOCKER_IMG_TAG }}
- name: Build Python package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Docker Push
run: |
docker push jantman/biweeklybudget:${{ steps.docker-build.outputs.DOCKER_IMG_TAG }}
docker tag jantman/biweeklybudget:${{ steps.docker-build.outputs.DOCKER_IMG_TAG }} jantman/biweeklybudget:${{ steps.get-version.outputs.APP_VERSION }}
docker push jantman/biweeklybudget:${{ steps.get-version.outputs.APP_VERSION }}
docker tag jantman/biweeklybudget:${{ steps.docker-build.outputs.DOCKER_IMG_TAG }} jantman/biweeklybudget:latest
docker push jantman/biweeklybudget:latest
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release_log.md
draft: false
prerelease: false