Manually Release #4
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: Manually Release | |
permissions: | |
contents: write | |
on: workflow_dispatch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if actor is repo owner | |
run: | | |
if [ "${{ github.repository_owner }}" != "LLM-Evaluation-s-Always-Fatiguing" ]; then | |
echo "Error: Only the repository owner can run this workflow." | |
exit 1 | |
fi | |
# checkout to main branch | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
# setup python 3.10 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Build with Poetry | |
run: | | |
poetry build | |
rm ./dist/*.whl | |
- name: Determine package version | |
id: package_version | |
run: | | |
echo "tag_name=v$(poetry version -s)" | |
echo ::set-output name=tag_name::$(poetry version -s) | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.package_version.outputs.tag_name }} | |
release_name: Release v${{ steps.package_version.outputs.tag_name }} | |
draft: false | |
prerelease: false | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: dist |