Skip to content

schedule: refs/heads/main #295

schedule: refs/heads/main

schedule: refs/heads/main #295

Workflow file for this run

# Continuous Integration/Deployment pipeline
name: "DevOps"
run-name: "${{ github.event_name }}: ${{ github.ref }}"
on:
issues:
types:
- opened
- labeled
issue_comment:
types:
- created
- edited
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
pull_request_target:
types:
- opened
- reopened
- synchronize
push:
schedule:
- cron: '43 23 * * *' # Every day at 23:43 UTC.
- cron: '43 6 * * 6' # Every Saturday at 6:43 UTC.
workflow_dispatch:
inputs:
meta-sync:
type: choice
options:
- report
- amend
- commit
- pull
- none
default: report
required: true
description: |
The action to take when the dynamic files are out of sync with the repository meta content.
Selecting 'none' will disable this action.
hooks:
type: choice
options:
- report
- amend
- commit
- pull
- none
default: report
required: true
description: |
The action to take when running the workflow hooks.
Selecting 'none' will disable this action.
package-build:
type: boolean
required: false
default: false
description: |
Build the package and upload the builds as artifacts.
package-lint:
type: boolean
required: false
default: false
description: |
Run the linting workflow.
package-test:
type: boolean
required: false
default: false
description: |
Run the test workflow on package.
website-build:
type: boolean
required: false
default: false
description: |
Build the documentation with Sphinx and upload the builds as artifacts.
first-major-release:
type: boolean
required: false
default: false
description: |
Release the current 0.X.Y version as the first major release.
jobs:
init:
name: 'Project'
uses: ./.github/workflows/_manager.yaml
permissions:
contents: write
issues: write
pull-requests: write
# with:
# package-build: ${{ inputs.package-build || false }}
# package-lint: ${{ inputs.package-lint || false }}
# package-test: ${{ inputs.package-test || false }}
# website-build: ${{ inputs.website-build || false }}
# meta-sync: ${{ inputs.meta-sync }}
# hooks: ${{ inputs.hooks }}
# first-major-release: ${{ inputs.first-major-release || false }}
secrets:
repo-admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
website:
name: 'Website'
needs: init
if: fromJSON(needs.init.outputs.run).website # fromJSON(needs.init.outputs.config).run.website_build
permissions:
contents: read
pages: write
id-token: write
environment:
name: GitHub Pages
url: ${{ fromJSON(needs.init.outputs.website).url }}
runs-on: ubuntu-latest
steps:
- uses: RepoDynamics/SphinxDocs@v1
with:
repository: ${{ fromJSON(needs.init.outputs.website).repository }}
ref: ${{ fromJSON(needs.init.outputs.website).ref }}
deploy: ${{ fromJSON(needs.init.outputs.website).deploy }}
path-website: ${{ fromJSON(needs.init.outputs.website).path-website }}
path-package-setup: ${{ fromJSON(needs.init.outputs.website).path-package }}
artifact-name: ${{ fromJSON(needs.init.outputs.website).artifact-name }}
lint:
name: 'Package Lint'
needs: init
if: fromJSON(needs.init.outputs.run).lint # fromJSON(needs.init.outputs.config).run.package_lint
permissions:
pull-requests: write
security-events: write
actions: read
contents: read
uses: ./.github/workflows/_pkg_lint.yaml
with:
config: ${{ needs.init.outputs.lint }}
# metadata: ${{ needs.init.outputs.metadata }}
# ref: ${{ fromJSON(needs.init.outputs.config).checkout.ref }}
# ref-before: ${{ fromJSON(needs.init.outputs.config).checkout.ref_before }}
test:
name: 'Package Test'
needs: init
if: fromJSON(needs.init.outputs.run).test # fromJSON(needs.init.outputs.config).run.package_test_local
uses: ./.github/workflows/_pkg_test.yaml
with:
config: ${{ needs.init.outputs.test }}
# metadata: ${{ needs.init.outputs.metadata }}
# package-source: GitHub
build:
name: 'Package Build'
needs: init
if: fromJSON(needs.init.outputs.run).build # fromJSON(needs.init.outputs.config).run.package_build
uses: ./.github/workflows/_pkg_build.yaml
with:
config: ${{ needs.init.outputs.build }}
# metadata: ${{ needs.init.outputs.metadata }}
# ref: ${{ fromJSON(needs.init.outputs.config).checkout.ref }}
# repository: ${{ fromJSON(needs.init.outputs.config).checkout.repository }}
publish-testpypi:
name: 'Package Publish'
needs: [init, build, test, lint]
if: fromJSON(needs.init.outputs.run).publish-testpypi # fromJSON(needs.init.outputs.config).run.package_publish_testpypi
permissions:
id-token: write
uses: ./.github/workflows/_pkg_publish.yaml
with:
config: ${{ needs.init.outputs.publish-testpypi }}
# platform: TestPyPI
# download-url: ${{ fromJSON(needs.init.outputs.config).package.download_url_testpypi }}
# upload-url: ${{ fromJSON(needs.init.outputs.config).package.upload_url_testpypi }}
test-testpypi:
name: 'Package Test: TestPyPI'
needs: [init, publish-testpypi]
if: fromJSON(needs.init.outputs.run).test-testpypi # ${{ !failure() && fromJSON(needs.init.outputs.config).run.package_test_testpypi }}
uses: ./.github/workflows/_pkg_test.yaml
with:
config: ${{ needs.init.outputs.test-testpypi }}
# config: ${{ needs.init.outputs.config }}
# metadata: ${{ needs.init.outputs.metadata }}
# package-source: TestPyPI
publish-pypi:
name: 'Package Publish'
needs: [init, test-testpypi]
if: fromJSON(needs.init.outputs.run).publish-pypi # ${{ !failure() && fromJSON(needs.init.outputs.config).run.package_publish_pypi }}
permissions:
id-token: write
uses: ./.github/workflows/_pkg_publish.yaml
with:
config: ${{ needs.init.outputs.publish-pypi }}
# platform: PyPI
# download-url: ${{ fromJSON(needs.init.outputs.config).package.download_url_pypi }}
# upload-url: ${{ fromJSON(needs.init.outputs.config).package.upload_url_pypi }}
test-pypi:
name: 'Package Test: PyPI'
needs: [init, publish-pypi]
if: fromJSON(needs.init.outputs.run).test-pypi # ${{ !failure() && fromJSON(needs.init.outputs.config).run.package_test_pypi }}
uses: ./.github/workflows/_pkg_test.yaml
with:
config: ${{ needs.init.outputs.test-pypi }}
# config: ${{ needs.init.outputs.config }}
# metadata: ${{ needs.init.outputs.metadata }}
# package-source: PyPI
finalize:
name: 'Finalize'
needs: [ init, build, website, test-pypi ]
if: ${{ !failure() && fromJSON(needs.init.outputs.run).finalize }}
permissions:
contents: write
discussions: write
runs-on: ubuntu-latest
steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# ref: ${{ fromJSON(needs.init.outputs.config).checkout.ref }}
- name: 'Download sdist and wheels artifacts'
uses: actions/download-artifact@v3
with:
name: ${{ fromJSON(needs.init.outputs.finalize).release.package-artifact-name }}
path: distribution
- name: 'Download gh-pages artifact'
uses: actions/download-artifact@v3
with:
name: ${{ fromJSON(needs.init.outputs.finalize).release.website-artifact-name }}
path: documentation
- name: 'Zip artifacts'
run: |
mv distribution/dist/*.tar.gz ./
zip -r wheels.zip distribution/dist
zip -r documentation.zip documentation
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ fromJSON(needs.init.outputs.finalize).release.name }}
tag_name: ${{ fromJSON(needs.init.outputs.finalize).release.tag-name }}
body: ${{ fromJSON(needs.init.outputs.finalize).release.body }}
prerelease: ${{ fromJSON(needs.init.outputs.finalize).release.prerelease }}
# discussion_category_name: ${{ fromJSON(needs.init.outputs.finalize).release.discussion_category_name }}
files: |
wheels.zip
documentation.zip
*.tar.gz