Skip to content

schedule: refs/heads/main #652

schedule: refs/heads/main

schedule: refs/heads/main #652

Workflow file for this run

# Project's main software development workflow.
name: 'Workflow'
run-name: '${{ github.event_name }}: ${{ github.ref }}'
on:
issues:
types:
- opened
- edited
- labeled
- assigned
- unassigned
- unlabeled
- locked
- unlocked
issue_comment:
types:
- created
- edited
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
pull_request_target:
types:
- opened
push:
schedule:
- cron: '43 23 * * *' # Every day at 23:43 UTC.
- cron: '43 6 * * 6' # Every Saturday at 6:43 UTC.
workflow_dispatch:
inputs:
config:
description: Configuration
type: choice
options:
- disable
- report
- pull
- pull & merge
- commit
default: report
required: true
lint:
description: Lint
type: choice
options:
- disable
- report
- pull
- pull & merge
- commit
default: report
required: true
build:
description: Build
type: boolean
default: false
required: true
test:
description: Test
type: boolean
default: false
required: true
website:
description: Website
type: boolean
default: false
required: true
release:
description: Release v1
type: boolean
default: false
required: true
jobs:
main:
name: Project
# If the event is 'pull_request_target', only run if its from a fork.
# TODO: Remove the first line after PyPackIT finalization.
if: >-
github.repository != 'RepoDynamics/PyPackIT'
&& (
(
github.event_name != 'pull_request_target'
|| github.event.pull_request.head.repo.full_name != github.repository
) && (
github.event_name != 'push'
|| (github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch)
)
)
uses: ./.github/workflows/_manager.yaml
permissions:
contents: write
issues: write
pull-requests: write
secrets:
repo-admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
zenodo-token: ${{ secrets.ZENODO_TOKEN }}
web:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.web)
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.web) }}
permissions:
pages: write
id-token: write
uses: ./.github/workflows/_web.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
lint:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.lint)
permissions:
pull-requests: write
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.lint) }}
uses: ./.github/workflows/_lint.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
test:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.test)
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.test) }}
uses: ./.github/workflows/_test.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
build:
name: ${{ matrix.config.name }}
needs: main
if: fromJSON(needs.main.outputs.build)
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.build) }}
uses: ./.github/workflows/_build.yaml
with:
config: ${{ toJSON(matrix.config.job) }}
publish-testpypi:
name: ${{ fromJSON(needs.main.outputs.publish-testpypi).name }}
needs: [main, web, lint, test, build]
if: fromJSON(needs.main.outputs.publish-testpypi)
permissions:
id-token: write
uses: ./.github/workflows/_publish.yaml
with:
config: ${{ fromJSON(needs.main.outputs.publish-testpypi).job }}
publish-pypi:
name: ${{ matrix.config.name }}
needs: [ main, publish-testpypi ]
if: fromJSON(needs.main.outputs.publish-pypi)
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.main.outputs.publish-pypi) }}
uses: ./.github/workflows/_publish.yaml
with:
config: ${{ matrix.config.job }}
release:
name: Release
needs: [ main, web, publish-pypi ]
if: fromJSON(needs.main.outputs.release)
permissions:
contents: write
discussions: write
runs-on: ubuntu-latest
steps:
- name: 'Download sdist and wheels artifacts'
uses: actions/download-artifact@v3
with:
name: ${{ fromJSON(needs.main.outputs.publish).release.package-artifact-name }}
path: distribution
- name: 'Download gh-pages artifact'
uses: actions/download-artifact@v3
with:
name: ${{ fromJSON(needs.main.outputs.publish).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.main.outputs.finalize).release.name }}
tag_name: ${{ fromJSON(needs.main.outputs.finalize).release.tag-name }}
body: ${{ fromJSON(needs.main.outputs.finalize).release.body }}
prerelease: ${{ fromJSON(needs.main.outputs.finalize).release.prerelease }}
# discussion_category_name: ${{ fromJSON(needs.main.outputs.finalize).release.discussion_category_name }}
files: |
wheels.zip
documentation.zip
*.tar.gz