-
Notifications
You must be signed in to change notification settings - Fork 19
69 lines (69 loc) · 2.65 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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