Skip to content

Release wheel

Release wheel #22

Workflow file for this run

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 Python version
run: |
sed -i "s/__version__ = '[0-9]\+\(\.[0-9]\+\)\{1,2\}\(rc[0-9]\+\|[ab][0-9]\+\)\?'/__version__ = '${{ github.event.inputs.version_tag }}'/g" wordcanvas/__init__.py
- name: Commit & Push changes of Version Updating
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.inputs.branch }}
message: "[C] Update python version"
- 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/wordcanvas-*-none-any.whl"
- name: Clean wheel
run: |
rm -fr ${{ github.workspace }}/dist/*