Skip to content

Commit

Permalink
Fixes issue #46 and issue #47
Browse files Browse the repository at this point in the history
  • Loading branch information
madeinoz67 committed May 22, 2021
1 parent eab6d66 commit 9e95c4e
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI - Changelog

on:
push:
branches: [master]

jobs:
changelog_prerelease:
name: Update Changelog For Prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master
- name: Update Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: false
prWoLabels: false
unreleased: true
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Changelog for PR
file_pattern: CHANGELOG.md
40 changes: 40 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish docs via GitHub Pages on release
on:
workflow_run:
workflows: ["Release"]
types:
- completed
env:
PYTHON_VERSION: 3.x
POETRY_VERSION: 1.1.4

jobs:
documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python runtime
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Python Poetry Action
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: View poetry version
run: poetry --version

- name: Install project dependencies
run: poetry install

- name: Deploy documentation
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
poetry run mkdocs gh-deploy --force
poetry run mkdocs --version
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
push:
tags:
- v*

jobs:
changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
- name: Get version from tag
env:
GITHUB_REF: ${{ github.ref }}
run: |
export CURRENT_VERSION=${GITHUB_TAG/refs\/tags\/v/}
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master
- name: Update Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Changelog for tag ${{ env.CURRENT_VERSION }}
file_pattern: CHANGELOG.md

release_notes:
name: Create Release Notes
runs-on: ubuntu-latest
needs: changelog
steps:
- name: Get version from tag
env:
GITHUB_REF: ${{ github.ref }}
run: |
export CURRENT_VERSION=${GITHUB_TAG/refs\/tags\/v/}
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v1
with:
version: ${{ env.CURRENT_VERSION }}
path: ./CHANGELOG.md

- 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: ${{ steps.changelog_reader.outputs.log_entry }}
draft: false
prerelease: false

0 comments on commit 9e95c4e

Please sign in to comment.