v0.2.41 #41
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 - Highflame Python | |
| on: | |
| release: | |
| types: | |
| - published | |
| env: | |
| PY_VER: 3.11.8 | |
| RELEASE_BRANCH: "main" | |
| REGEX_PATTERN: "^v[0-9]+\\.[0-9]+\\.[0-9]+$" | |
| RELEASE_NAME: ${{ github.event.release.name }} | |
| jobs: | |
| highflame-validate: | |
| permissions: | |
| contents: 'read' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| # - name: Validate Release Branch | |
| # id: validate_branch | |
| # shell: bash | |
| # run: |- | |
| # export TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }}) | |
| # export TAG_BRANCH=$(git branch -r --contains ${TAG_COMMIT} | grep -v HEAD | head -n 1 | sed 's/origin\///' | sed 's/^[ \t]*//') | |
| # if [[ "${TAG_BRANCH}" == "${{ env.RELEASE_BRANCH }}" ]] ; then | |
| # echo "Valid Branch for Release : ${TAG_BRANCH}" | |
| # echo "enable_branch_build=true" >> ${GITHUB_OUTPUT} | |
| # else | |
| # echo "Invalid Branch for Release : ${TAG_BRANCH}" | |
| # echo "enable_branch_build=false" >> ${GITHUB_OUTPUT} | |
| # exit 1 | |
| # fi | |
| - name: Validate Release Tag | |
| # if: ${{ steps.validate_branch.outputs.enable_branch_build == 'true' }} | |
| id: validate_tag | |
| shell: bash | |
| run: |- | |
| if [[ "${{ env.RELEASE_NAME }}" =~ ${{ env.REGEX_PATTERN }} ]] ; then | |
| echo "Valid version format: ${{ env.RELEASE_NAME }}" | |
| echo "enable_tag_build=true" >> ${GITHUB_OUTPUT} | |
| else | |
| echo "Invalid version format: ${{ env.RELEASE_NAME }}" | |
| echo "enable_tag_build=false" >> ${GITHUB_OUTPUT} | |
| exit 1 | |
| fi | |
| highflame-package: | |
| needs: | |
| - highflame-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 [[ -f ${{ env.PY_VER_FILE }} ]] ; then | |
| sed -i "s|^version = \".*\"|version = \"${RELEASE_VERSION}\"|g" ${{ env.PY_VER_FILE }} | |
| cat ${{ env.PY_VER_FILE }} | |
| echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ${{ env.PY_VER_FILE }}" | |
| else | |
| echo "File not found ${{ env.PY_VER_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.13.0 | |
| # with: | |
| # user: __token__ | |
| # password: ${{ secrets.PYPI_API_TOKEN }} |