Test new job templates.

This commit is contained in:
Patrick Lehmann
2025-04-26 15:00:18 +02:00
parent c1f0e4a16b
commit 12389ac0f0
6 changed files with 131 additions and 8 deletions

View File

@@ -125,6 +125,9 @@ on:
required: false
jobs:
Prepare:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
with:
@@ -309,12 +312,21 @@ jobs:
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
ReleasePage:
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@dev
if: startsWith(github.ref, 'refs/tags')
needs:
- Package
- Prepare
- UnitTesting
# - AppTesting
# - StaticTypeCheck
- Package
- PublishToGitHubPages
secrets: inherit
permissions:
contents: write
actions: write
with:
tag: ${{ needs.Prepare.outputs.version }}
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev

84
.github/workflows/TagReleaseCommit.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
# ==================================================================================================================== #
# Authors: #
# Patrick Lehmann #
# Unai Martinez-Corral #
# #
# ==================================================================================================================== #
# Copyright 2020-2025 The pyTooling Authors #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# #
# SPDX-License-Identifier: Apache-2.0 #
# ==================================================================================================================== #
name: Auto Tag
on:
workflow_call:
inputs:
ubuntu_image:
description: 'Name of the Ubuntu image.'
required: false
default: 'ubuntu-24.04'
type: string
version:
description: 'Version used as tag name.'
required: true
type: string
auto_tag:
description: 'Automatically add and push a tag.'
required: true
type: string
workflow:
description: 'Workflow to start after adding a tag.'
required: false
default: 'Pipeline.yml'
type: string
jobs:
AutoTag:
name: "🏷 Create tag '${{ inputs.version}}' on GitHub"
runs-on: ${{ inputs.ubuntu_image }}
if: inputs.auto_tag == 'true'
# if: github.ref == 'refs/heads/${{ inputs.release_branch }}'
permissions:
contents: write # required for tag creation
actions: write # required to start a new pipeline
steps:
- name: 🏷 Create release tag '${{ steps.FindPullRequest.outputs.version }}'
uses: actions/github-script@v7
id: createReleaseTag
# if: inputs.auto_tag == 'true'
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ inputs.version }}',
sha: context.sha
})
- name: Trigger Workflow
uses: actions/github-script@v7
id: runReleaseTag
# if: inputs.auto_tag == 'true'
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: '${{ inputs.workflow }}',
ref: '${{ inputs.version }}'
})

View File

@@ -5,6 +5,9 @@ on:
workflow_dispatch:
jobs:
Prepare:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
with:
@@ -189,15 +192,39 @@ jobs:
coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
ReleasePage:
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
if: startsWith(github.ref, 'refs/tags')
TriggerTaggedRelease:
uses: pyTooling/Actions/.github/workflows/TagReleaseCommit.yml@dev
needs:
- Prepare
- UnitTesting
- PlatformTesting
# - StaticTypeCheck
- Package
- PublishToGitHubPages
permissions:
contents: write # required for create tag
actions: write # required for trigger workflow
with:
version: ${{ needs.Prepare.outputs.version }}
auto_tag: ${{ needs.Prepare.outputs.is_release_commit }}
secrets: inherit
ReleasePage:
uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@dev
if: startsWith(github.ref, 'refs/tags')
needs:
- Prepare
- UnitTesting
- PlatformTesting
# - StaticTypeCheck
- Package
- PublishToGitHubPages
secrets: inherit
permissions:
contents: write
actions: write
with:
tag: ${{ needs.Prepare.outputs.version }}
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev

View File

@@ -77,7 +77,7 @@ As shown in the screenshots above, the expected order is:
[**NightlyRelease**](.github/workflows/NightlyRelease.yml): publish GitHub Release.
[**Release**](.github/workflows/Release.yml): publish GitHub Release.
[**PublishReleaseNotes**](.github/workflows/PublishReleaseNotes.yml): publish GitHub Release.
- **Documentation:**
[**SphinxDocumentation**](.github/workflows/PublishCoverageResults.yml): create HTML and LaTeX documentation using
Sphinx.