Release wheel #8
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 wheel | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Create release with branch or sha1" | |
default: "main" | |
required: true | |
version_tag: | |
description: "Release version (a.b.c)" | |
required: true | |
jobs: | |
Release: | |
runs-on: [self-hosted, unicorn] | |
strategy: | |
matrix: | |
python-version: | |
- "3.10" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
check-latest: true | |
python-version: ${{ matrix.python-version }} | |
- name: Update version of package | |
run: | | |
sed -i "s/__version__ = '[0-9]\+\(\.[0-9]\+\)\{1,2\}\(rc[0-9]\+\|[ab][0-9]\+\)\?'/__version__ = '${{ github.event.inputs.version_tag }}'/g" docclassifier/__init__.py | |
- name: Commit & Push changes of Version Updating | |
uses: actions-js/push@master | |
with: | |
branch: ${{ github.event.inputs.branch }} | |
message: "[C] Update version" | |
github_token: ${{ secrets.CI_PAT }} | |
- name: Build wheel | |
run: | | |
python -m pip install wheel twine | |
python setup.py bdist_wheel | |
python -m twine upload -u admin -p ${{ secrets.TWINE_PASSWORD }} \ | |
--repository-url http://192.168.0.105:18080 \ | |
${{ github.workspace }}/dist/*.whl | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ github.event.inputs.version_tag }} | |
name: Release ${{ github.event.inputs.version_tag }} | |
body: | | |
# Release Note | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
draft: true | |
prerelease: false | |
generateReleaseNotes: true | |
discussionCategory: General | |
artifacts: "${{ github.workspace }}/dist/docclassifier-*-none-any.whl" | |
- name: Clean wheel | |
run: | | |
rm -fr ${{ github.workspace }}/dist/* |