Skip to content

Commit

Permalink
refactor actions (#148)
Browse files Browse the repository at this point in the history
* refactor of actions to add docs
* no more gh-pages submodule
  • Loading branch information
obriencj authored Sep 19, 2023
1 parent b897c00 commit 904cbc3
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 165 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Build: Documentation"


on:
workflow_dispatch:
workflow_call:


jobs:

build-documentation:
runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Dependencies
run: |
sudo apt-get install make pandoc
pip install tox tox-gh-actions
- name: Generate Documentation
run: |
make docs
- name: Store Documentation
uses: actions/upload-pages-artifact@v2
with:
path:
build/sphinx/dirhtml


# The end.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

name: RPM Build
name: "Build: RPMs"


on:
Expand All @@ -8,6 +7,7 @@ on:


jobs:

build-srpm:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -82,11 +82,11 @@ jobs:
run: |
make archive
- name: Generate ${{ matrix.platform }} RPM
- name: Generate RPM ${{ matrix.platform }}
run: |
tools/launch-build.sh ${{ matrix.platform }}
- name: Store ${{ matrix.platform }} RPM
- name: Store RPM ${{ matrix.platform }}
uses: actions/upload-artifact@v3
with:
name: RPMs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

name: Wheel Build
name: "Build: Wheel"


on:
Expand All @@ -8,6 +7,7 @@ on:


jobs:

build-wheel:
runs-on: ubuntu-latest

Expand All @@ -27,7 +27,7 @@ jobs:
run: |
pip install build
- name: Build Wheel
- name: Generate Wheel
run: |
python -B -m build .
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Trigger: on Push/PR"


on:
workflow_dispatch:

push:
branches:
- master
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/run_bandit.yml'
- '.github/workflows/run_tests.yml'

pull_request:
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/run_bandit.yml'
- '.github/workflows/run_tests.yml'


jobs:
run-bandit:
uses: ./.github/workflows/run_bandit.yml

run-tests:
uses: ./.github/workflows/run_tests.yml


# The end.
61 changes: 36 additions & 25 deletions .github/workflows/release.yml → .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Github Action definition for publishing assets to the release and to
# PyPI when a release is tagged. Also emits a notification post to
# mastodon


name: Release Assets
name: "Trigger: on Release"


on:
Expand Down Expand Up @@ -54,15 +49,16 @@ jobs:
path: release.md

build-wheel:
name: Trigger Wheel build
uses: ./.github/workflows/wheel.yml
uses: ./.github/workflows/build_wheel.yml

build-rpms:
name: Trigger RPM builds
uses: ./.github/workflows/rpms.yml
uses: ./.github/workflows/build_rpms.yml

build-docs:
uses: ./.github/workflows/build_docs.yml

attach-assets:
name: Attach Assets to Release
deploy-release:
name: Deploy assets to release
runs-on: ubuntu-latest

permissions:
Expand All @@ -74,9 +70,6 @@ jobs:
- build-rpms

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: |
sudo apt-get install hub
Expand All @@ -102,6 +95,8 @@ jobs:
run: |
gh release edit ${{ github.ref_name }} \
-F release.md
env:
GITHUB_TOKEN: ${{ github.TOKEN }}

- name: Upload python dist content
run: |
Expand All @@ -110,7 +105,27 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.TOKEN }}

pypi:
deploy-docs:
name: Deploy documentation
runs-on: ubuntu-latest

needs:
- build-docs

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}

steps:
- name: Deploy site
id: deploy
uses: actions/deploy-pages@v2

deploy-pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest

Expand Down Expand Up @@ -139,13 +154,11 @@ jobs:
runs-on: ubuntu-latest

needs:
- attach-assets
- pypi
- deploy-release
- deploy-docs
- deploy-pypi

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Fetch python dist content
uses: actions/download-artifact@v3
with:
Expand All @@ -159,10 +172,8 @@ jobs:
run: |
echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
- name: "\
Trigger announcement for ${{ env.DIST_VERSION }}(tag
${{ github.ref_name }}) on ${{ env.RELEASE_DATE }}"
uses: ./.github/workflows/announce.yml
- name: Post announcement
uses: ./.github/workflows/run_announce.yml
with:
version: ${{ env.DIST_VERSION }}
date: ${{ env.RELEASE_DATE }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Github Action definition for creating a mastodon release for this
# project.


name: Announce Release
name: "Run: Announcement"


on:
workflow_call:
# shame github actions parses yaml with anchors disabled
inputs:
version:
description: package version to announce
Expand Down Expand Up @@ -43,7 +38,6 @@ on:


jobs:

announce:
name: Announce release to @[email protected]
runs-on: ubuntu-latest
Expand All @@ -56,12 +50,16 @@ jobs:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}

message: "\
Version ${{ inputs.version }} of koji-smoky-dingo was
koji-smoky-dingo ${{ inputs.version }} was
released on ${{ inputs.date }}
View the release on GitHub:
https://github.com/obriencj/koji-smoky-dingo/releases/tag/\
${{ inputs.ref }}
#koji #kojismokydingo"


Expand Down
33 changes: 4 additions & 29 deletions .github/workflows/bandit.yml → .github/workflows/run_bandit.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
# Github Action definitions for running a Bandit scan and storing the
# results in the security tab


name: Bandit
name: "Run: Bandit Scan"


on:
push:
branches:
- master
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/bandit.yml'

pull_request:
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/bandit.yml'
workflow_call:
workflow_dispatch:


jobs:
Expand All @@ -42,7 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
Expand Down
35 changes: 3 additions & 32 deletions .github/workflows/tox.yml → .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
# Github Action definition for running tox across the supported python
# versions. Intended to be triggered on push to master and on filing
# of a pull_request, when those pushes hit something that impacts the
# running of the tests.


name: Tox
name: "Run: Unit Tests"


on:
workflow_call:
workflow_dispatch:

push:
branches:
- master
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/tox.yml'

pull_request:
ignore-paths:
- 'docs/**'
- 'examples/**'
- 'tools/**'
paths:
- 'setup.cfg'
- '**/*.py'
- '**/*.pyi'
- '.github/workflows/tox.yml'


jobs:
pre-tests:
Expand All @@ -46,7 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "gh-pages"]
path = gh-pages
url = https://github.com/obriencj/koji-smoky-dingo.git
# pushurl = [email protected]:obriencj/koji-smoky-dingo.git
branch = gh-pages

Loading

0 comments on commit 904cbc3

Please sign in to comment.