Merge links on nodes: create user node output from topo node output #3722
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org> | |
| # | |
| # SPDX-License-Identifier: MPL-2.0 | |
| name: CI Build | |
| # Controls when the workflow will run. | |
| on: | |
| # run pipeline on push event of main branch | |
| push: | |
| branches: | |
| - main | |
| # run pipeline on pull request | |
| pull_request: | |
| # run pipeline on merge queue | |
| merge_group: | |
| # run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| inputs: | |
| create_release: | |
| type: boolean | |
| description: Create a (pre-)release when CI passes | |
| default: false | |
| required: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-ci-build | |
| cancel-in-progress: true | |
| jobs: | |
| ci-started: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "ci started" | |
| build-test-release: | |
| name: build-test-release | |
| uses: "./.github/workflows/build-test-release.yml" | |
| github-release: | |
| name: Create and release assets to GitHub | |
| needs: build-test-release | |
| # true if the event that triggered this workflow is "workflow_dispatch" and inputs.create_release is true | |
| # true if the event that triggered this workflow is "push" on main | |
| # otherwise false | |
| if: (github.event_name == 'workflow_dispatch' && inputs.create_release) || github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| environment: release | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: version | |
| path: . | |
| - name: Combine wheelhouses | |
| run: mv wheelhouse-*/* wheelhouse | |
| - name: List assets | |
| run: ls ./wheelhouse/ -al | |
| - name: Get tag | |
| id: tag | |
| run: echo "tag=v$(cat VERSION)" >> $GITHUB_OUTPUT | |
| - name: Display tag | |
| run: echo "${{ steps.tag.outputs.tag }}" | |
| - name: generate GitHub App token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| id: generate-token | |
| with: | |
| client-id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | |
| repositories: ${{ github.repository }} | |
| permission-contents: write | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 | |
| with: | |
| files: | | |
| ./wheelhouse/* | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| prerelease: ${{ github.ref != 'refs/heads/main'}} | |
| generate_release_notes: true | |
| target_commitish: ${{ github.sha }} | |
| token: ${{ steps.generate-token.outputs.token }} | |
| check-code-quality: | |
| uses: "./.github/workflows/check-code-quality.yml" | |
| reuse-compliance: | |
| uses: "./.github/workflows/reuse-compliance.yml" | |
| clang-tidy: | |
| uses: "./.github/workflows/clang-tidy.yml" | |
| with: | |
| target: "all" | |
| ci-passed: | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| ci-started, | |
| build-test-release, | |
| check-code-quality, | |
| reuse-compliance, | |
| clang-tidy, | |
| ] | |
| if: always() | |
| steps: | |
| # this explicit check is needed cfr. https://github.com/orgs/community/discussions/75568 | |
| - name: "Check whether all jobs passed" | |
| run: echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")' | |
| - run: echo "ci passed" | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for Trusted Publishing | |
| environment: release | |
| needs: github-release | |
| if: (github.event_name == 'workflow_dispatch') || github.event_name == 'push' | |
| steps: | |
| - name: Download assets from GitHub release | |
| uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13 | |
| with: | |
| repository: ${{ github.repository }} | |
| # download the latest release | |
| latest: true | |
| # don't download pre-releases | |
| preRelease: false | |
| fileName: "*" | |
| # don't download GitHub-generated source tar and zip files | |
| tarBall: false | |
| zipBall: false | |
| # create a directory to store the downloaded assets | |
| out-file-path: assets-to-publish | |
| # don't extract downloaded files | |
| extract: false | |
| - name: List downloaded assets | |
| run: ls -la assets-to-publish | |
| - name: Upload assets to PyPI | |
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | |
| with: | |
| # To test, use the TestPyPI: | |
| # repository-url: https://test.pypi.org/legacy/ | |
| # You must also create an account and project on TestPyPI, | |
| # as well as set the trusted-publisher in the project settings: | |
| # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ | |
| # To publish to the official PyPI repository, just keep | |
| # repository-url commented out. | |
| packages-dir: assets-to-publish | |
| skip-existing: true | |
| print-hash: true | |
| verbose: true |