diff --git a/.github/workflows/CompletePipeline.yml b/.github/workflows/CompletePipeline.yml index d2f968a..7ec64de 100644 --- a/.github/workflows/CompletePipeline.yml +++ b/.github/workflows/CompletePipeline.yml @@ -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 diff --git a/.github/workflows/Prepare.yml b/.github/workflows/PrepareJob.yml similarity index 100% rename from .github/workflows/Prepare.yml rename to .github/workflows/PrepareJob.yml diff --git a/.github/workflows/Release.yml b/.github/workflows/PublishReleaseNotes.yml similarity index 100% rename from .github/workflows/Release.yml rename to .github/workflows/PublishReleaseNotes.yml diff --git a/.github/workflows/TagReleaseCommit.yml b/.github/workflows/TagReleaseCommit.yml new file mode 100644 index 0000000..4aa28d3 --- /dev/null +++ b/.github/workflows/TagReleaseCommit.yml @@ -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 }}' + }) diff --git a/.github/workflows/_Checking_JobTemplates.yml b/.github/workflows/_Checking_JobTemplates.yml index 06e8fd5..e726dfe 100644 --- a/.github/workflows/_Checking_JobTemplates.yml +++ b/.github/workflows/_Checking_JobTemplates.yml @@ -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: @@ -185,19 +188,43 @@ jobs: - PublishCoverageResults - StaticTypeCheck with: - doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} - typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_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 diff --git a/README.md b/README.md index 499e97c..ec7dc16 100644 --- a/README.md +++ b/README.md @@ -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.