v1.5.3 #45
Workflow file for this run
This file contains 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-Python | |
# 触发脚本的事件 这里为发布release之后触发 | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Build and publish Python package | |
run: | | |
pip install grpcio-tools | |
python source/python/build.py | |
cd source/python/ | |
sed -i "s/#VERSION#/${VERSION}/g" src/polarismesh_specification/__about__.py | |
cat src/polarismesh_specification/__about__.py | |
pip install --upgrade hatch | |
hatch build | |
hatch publish --no-prompt | |
env: | |
HATCH_INDEX_USER: __token__ | |
HATCH_INDEX_AUTH: ${{ secrets.HATCH_INDEX_AUTH }} | |
VERSION: ${{ steps.get_version.outputs.VERSION }} |