v0.2.30 #28
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
| name: Release Build - Javelin Python | |
| on: | |
| release: | |
| types: | |
| - published | |
| env: | |
| env_var: ${{ vars.ENV_CONTEXT_VAR }} | |
| DEVOPS_REPO: "javelin-cloud" | |
| DEVOPS_BRANCH: "main" | |
| PY_VER: 3.11.8 | |
| PIPELINE_ROLE: "release" | |
| jobs: | |
| reusable-vars: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: reusable variables | |
| run: echo "Exposing env vars" | |
| outputs: | |
| PIPELINE_ROLE: ${{ env.PIPELINE_ROLE }} | |
| reusable-workflow-env: | |
| needs: | |
| - reusable-vars | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| uses: getjavelin/javelin-workflow/.github/workflows/workflow-release-env.yml@main | |
| with: | |
| PIPELINE_ROLE: ${{ needs.reusable-vars.outputs.PIPELINE_ROLE }} | |
| secrets: | |
| DEVOPS_GITHUB_TOKEN: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
| javelin-validate: | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Validate Release | |
| env: | |
| RELEASE_NAME: ${{ github.event.release.name }} | |
| REGEX_PATTERN: "^v[0-9]+\\.[0-9]+\\.[0-9]+$" | |
| shell: bash | |
| run: |- | |
| if [[ "${{ env.RELEASE_NAME }}" =~ ${{ env.REGEX_PATTERN }} ]]; then | |
| echo "Valid version format: ${{ env.RELEASE_NAME }}" | |
| else | |
| echo "Invalid version format: ${{ env.RELEASE_NAME }}" | |
| exit 1 | |
| fi | |
| javelin-package: | |
| needs: | |
| - javelin-validate | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setting up the Package Version | |
| env: | |
| PY_VER_FILE: "pyproject.toml" | |
| RELEASE_NAME: ${{ github.event.release.name }} | |
| shell: bash | |
| run: |- | |
| export RELEASE_VERSION=$(echo ${{ env.RELEASE_NAME }} | sed 's|^v||g') | |
| if cat ${{ env.PY_VER_FILE }} | grep 'version = "RELEASE_VERSION"' ; then | |
| sed -i "s|^version = \"RELEASE_VERSION\"|version = \"${RELEASE_VERSION}\"|g" ${{ env.PY_VER_FILE }} | |
| cat ${file} | |
| else | |
| echo "Version entry format is wrong in the ${{ env.PY_VER_FILE }} file...!" | |
| cat ${file} | |
| exit 1 | |
| fi | |
| - name: Set up Python Version | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PY_VER }} | |
| cache: 'pip' | |
| - name: Install Dependencies | |
| shell: bash | |
| run: |- | |
| pip install build | |
| - name: Build Package | |
| shell: bash | |
| run: |- | |
| python -m build | |
| - name: Publish Package | |
| uses: pypa/gh-action-pypi-publish@v1.10.2 | |
| # with: | |
| # user: __token__ | |
| # password: ${{ secrets.PYPI_API_TOKEN }} | |
| reusable-workflow-notify: | |
| needs: | |
| - reusable-workflow-env | |
| - javelin-package | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| if: | | |
| always() && (needs.javelin-package.result != 'success') | |
| uses: getjavelin/javelin-workflow/.github/workflows/workflow-package-notify.yml@main | |
| with: | |
| SVC_NAME: ${{ needs.reusable-workflow-env.outputs.lc_repository }} | |
| JOB_STATUS: ${{ needs.javelin-package.result }} | |
| JOB_STATUS_MARK: ":x:" | |
| RELEASE_AUTHOR: ${{ github.event.release.author.login }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| secrets: | |
| DEVOPS_GITHUB_TOKEN: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| reusable-workflow-changelog: | |
| needs: | |
| - javelin-package | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| uses: getjavelin/javelin-workflow/.github/workflows/workflow-release-changelog.yml@main | |
| secrets: | |
| DEVOPS_GITHUB_TOKEN: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |