Skip to content

Commit

Permalink
Merge dev branch to main (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzorianMatt authored Feb 1, 2024
1 parent e5e319e commit 6f75a1a
Show file tree
Hide file tree
Showing 25 changed files with 556 additions and 117 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
---
name: 'Docker Image'
name: 'Image Build'

on:
workflow_dispatch:
push:
branches:
- '-dev'
- '-main'
- 'dev'
- 'main'
- 'dependabot/**'
- 'feature/**'
- 'issue/**'
- 'release/**'
tags:
- 'v*.*.*'
paths:
- deployment/**
- src/**
- tests/**
- setup.py
pull_request:
branches:
- 'dev'
- 'main'
- 'dependabot/**'
- 'feature/**'
- 'issue/**'
- 'release/**'
paths:
- deployment/**
- src/**
- tests/**
- setup.py

jobs:
build-and-push-docker-image:
name: Build Docker Image
build-and-push-image:
name: Build Image
runs-on: ubuntu-latest

steps:
Expand All @@ -28,7 +46,7 @@ jobs:
uses: docker/metadata-action@v3
with:
images: |
powerdnsadmin/pda-legacy
powerdnsadmin/pda
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
Expand All @@ -51,14 +69,14 @@ jobs:
context: ./
file: ./docker/Dockerfile
push: true
tags: powerdnsadmin/pda-legacy:${{ github.ref_name }}
tags: powerdnsadmin/pda:${{ github.ref_name }}

- name: Docker Image Release Tagging
uses: docker/build-push-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
context: ./
file: ./docker/Dockerfile
file: ./deployment/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
42 changes: 35 additions & 7 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,41 @@ name: MegaLinter
on:
workflow_dispatch:
push:
branches-ignore:
- "*"
- 'dev'
- 'master'
- "dependabot/**"
- 'feature/*'
- 'issue/**'
branches:
- '-dev'
- '-main'
- '-dependabot/**'
- '-feature/**'
- '-issue/**'
- '-release/**'
tags:
- '-v*.*.*'
paths:
- .github/**
- deployment/**
- docs/**
- src/**
- tests/**
- setup.py
- '*.md'
pull_request:
branches:
- '-dev'
- '-main'
- '-dependabot/**'
- '-feature/**'
- '-issue/**'
- '-release/**'
tags:
- '-v*.*.*'
paths:
- .github/**
- deployment/**
- docs/**
- src/**
- tests/**
- setup.py
- '*.md'

env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/project-release-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 'Project Release (Test)'

on:
workflow_dispatch:

jobs:
test-build-publish-package:
name: Test, Build, & Publish Python Package
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: write

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up the environment to run Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

# Set up the environment to run the latest Python build, test, and publish tools
- name: Set Up Environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade pytest
python3 -m pip install --upgrade twine
# Install the package from source
- name: Install Source Code
run: |
python3 -m pip install .
# Run the package tests
- name: Test Source Code
run: |
python3 -m pytest -v
# Build the package
- name: Build Package
run: |
python3 -m pip install --upgrade build
python3 -m build
# Check the distribution files with Twine
- name: Check Package
run: |
python3 -m twine check dist/*
# Store the distribution files as artifacts
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/

# Upload the distribution artifacts to PyPi test environment for all (supported) scenarios
- name: Publish Package (PyPi Test)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository-url: https://test.pypi.org/legacy/
94 changes: 94 additions & 0 deletions .github/workflows/project-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: 'Project Release'

on:
workflow_dispatch:

jobs:
test-build-publish-package:
name: Test, Build, & Publish Python Package
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: write

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up the environment to run Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

# Set up the environment to run the latest Python build, test, and publish tools
- name: Set Up Environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade pytest
python3 -m pip install --upgrade twine
# Install the package from source
- name: Install Source Code
run: |
python3 -m pip install .
# Run the package tests
- name: Test Source Code
run: |
python3 -m pytest -v
# Build the package
- name: Build Package
run: |
python3 -m pip install --upgrade build
python3 -m build
# Check the distribution files with Twine
- name: Check Package
run: |
python3 -m twine check dist/*
# Store the distribution files as artifacts
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/

# Upload the distribution artifacts to PyPi production environment
- name: Publish Package (PyPi)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
password: ${{ secrets.PYPI_TOKEN }}

# Sign the distribution files with Sigstore
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
# Create a GitHub Release
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
gh release create -d
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
# Upload the distribution artifact signatures to the GitHub Release
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
85 changes: 85 additions & 0 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: 'Python Build'

on:
workflow_dispatch:
push:
branches:
- 'dev'
- 'main'
- 'dependabot/**'
- 'feature/**'
- 'issue/**'
- 'release/**'
tags:
- 'v*.*.*'
paths:
- src/**
- tests/**
- setup.py
pull_request:
branches:
- 'dev'
- 'main'
- 'dependabot/**'
- 'feature/**'
- 'issue/**'
- 'release/**'
tags:
- 'v*.*.*'
paths:
- src/**
- tests/**
- setup.py

jobs:
test-build-package:
name: Test & Build Python Package
runs-on: ubuntu-20.04

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up the environment to run Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

# Set up the environment to run the latest Python build, test, and publish tools
- name: Set Up Environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade pytest
python3 -m pip install --upgrade twine
# Install the package from source
- name: Install Source Code
run: |
python3 -m pip install .
# Run the package tests
- name: Test Source Code
run: |
python3 -m pytest -v
# Build the package
- name: Build Package
run: |
python3 -m pip install --upgrade build
python3 -m build
# Check the distribution files with Twine
- name: Check Package
run: |
python3 -m twine check dist/*
# Store the distribution files as artifacts
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/
Loading

0 comments on commit 6f75a1a

Please sign in to comment.