| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you 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. |
| |
| name: Publish Compiler |
| run-name: "Compiler Release: ${{ github.ref_name }}" |
| |
| on: |
| push: |
| tags: ['v*'] |
| |
| permissions: |
| contents: read |
| id-token: write |
| |
| jobs: |
| publish-compiler: |
| runs-on: ubuntu-latest |
| if: github.repository == 'apache/fory' && !startsWith(github.ref_name, 'go/fory') |
| steps: |
| - uses: actions/checkout@v5 |
| |
| - uses: actions/setup-python@v5 |
| with: |
| python-version: '3.11' |
| cache: 'pip' |
| |
| - name: Bump compiler version |
| shell: bash |
| run: | |
| set -euo pipefail |
| VERSION="${{ github.ref_name }}" |
| VERSION="${VERSION#v}" |
| python ci/release.py bump_version -l compiler -version "$VERSION" |
| |
| - name: Build compiler package |
| shell: bash |
| run: | |
| set -euo pipefail |
| python -m pip install --upgrade pip build |
| cd compiler |
| python -m build --sdist --wheel |
| |
| - name: Publish to TestPyPI |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.14.0 |
| if: ${{ contains(github.ref_name, '-') }} |
| with: |
| repository-url: https://test.pypi.org/legacy/ |
| skip-existing: true |
| verbose: true |
| verify-metadata: false |
| packages-dir: compiler/dist |
| |
| - name: Publish to PyPI |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.14.0 |
| if: ${{ !contains(github.ref_name, '-') }} |
| with: |
| skip-existing: true |
| verify-metadata: false |
| packages-dir: compiler/dist |