Repository navigation
Release 1.76.0 #84
Workflow file for this run
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
| # (C) 2022 GoodData Corporation | |
| # This workflow will upload a Python Package using Twine when a release is created | |
| # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Build Python Package and Create Release | |
| on: | |
| push: | |
| tags: | |
| - v*.*.* | |
| # One release at a time. Each tag is unique, so runs never collide on the tag itself, but | |
| # is_latest is computed once per run: with two releases in flight, the earlier tag can | |
| # finish last and take the "Latest" badge back from the newer one. Serializing keeps the | |
| # badge in release order. Never cancels -- a cancelled run leaves components half-published. | |
| concurrency: | |
| group: build-release | |
| cancel-in-progress: false | |
| env: | |
| COMPONENTS: '["gooddata-api-client","gooddata-pandas","gooddata-fdw","gooddata-sdk","gooddata-dbt","gooddata-flight-server","gooddata-flexconnect","gooddata-pipelines","gooddata-eval"]' | |
| jobs: | |
| matrix-components: | |
| name: Prepare matrix components | |
| runs-on: ubuntu-latest | |
| outputs: | |
| components: ${{ steps.export.outputs.components }} | |
| steps: | |
| - name: Export components JSON | |
| id: export | |
| run: echo "components=${COMPONENTS}" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build all components | |
| needs: matrix-components | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| component: ${{ fromJSON(needs.matrix-components.outputs.components) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v10.0.1 | |
| with: | |
| prune-cache: true | |
| - name: Build ${{ matrix.component }} | |
| run: | | |
| if [ "${{ matrix.component }}" = "gooddata-api-client" ]; then | |
| cd ${{ matrix.component }} | |
| else | |
| cd packages/${{ matrix.component }} | |
| fi | |
| uv build --out-dir dist | |
| - name: Persist ${{ matrix.component }} artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: artifacts_${{ matrix.component }} | |
| path: | | |
| ${{ matrix.component == 'gooddata-api-client' && format('{0}/dist/', matrix.component) || format('packages/{0}/dist/', matrix.component) }} | |
| if-no-files-found: error | |
| tag-checks: | |
| name: Check the triggering tag | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| is_latest: ${{ steps.check.outputs.is_latest }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # the checks need every tag and the default branch | |
| - id: check | |
| uses: ./.github/actions/release-tag-checks | |
| github_release: | |
| name: Create GitHub release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - tag-checks | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Obtain artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: dist/ | |
| - name: Generate changelog | |
| id: changelog | |
| uses: requarks/changelog-action@v1 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| tag: ${{ github.ref_name }} | |
| writeToFile: false | |
| includeRefIssues: false | |
| useGitmojis: false | |
| - name: Create GitHub release | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| body: ${{ steps.changelog.outputs.changes }} | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| draft: false | |
| prerelease: false | |
| # False for a patch of an older line, so v1.60.1 does not take the badge from | |
| # v1.73.0. Only in force for tags whose tree contains this file -- see MAINTENANCE.md. | |
| make_latest: ${{ needs.tag-checks.outputs.is_latest }} | |
| files: | | |
| dist/**/*.whl | |
| dist/**/*.tar.gz | |
| publish: | |
| name: Publish components | |
| runs-on: ubuntu-latest | |
| needs: | |
| - matrix-components | |
| - build | |
| permissions: | |
| id-token: write | |
| strategy: | |
| matrix: | |
| component: ${{ fromJSON(needs.matrix-components.outputs.components) }} | |
| steps: | |
| - name: Obtain ${{ matrix.component }} artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: artifacts_${{ matrix.component }} | |
| path: dist/${{ matrix.component }} | |
| - name: Push ${{ matrix.component}} to pypi | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/${{ matrix.component }} | |
| verbose: true | |
| slack-notification: | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| steps: | |
| - name: Notify to slack | |
| uses: slackapi/slack-github-action@v2.0.0 | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: "#releases" | |
| text: "The release of *gooddata-python-sdk@${{ github.ref_name }}*, has been successful. :tada:" |