-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (62 loc) · 2.03 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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@v4
with:
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.CI_PAT_DS }}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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" chameleon/__init__.py
- name: Commit & Push changes of Version Updating
uses: actions-js/push@master
with:
branch: ${{ github.event.inputs.branch }}
message: "[C] Update package version"
github_token: ${{ secrets.CI_PAT_DS }}
- name: Build wheel
run: |
python -m pip install wheel twine
python setup.py bdist_wheel
python -m twine upload 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/chameleon_docsaid-*-none-any.whl"
- name: Clean wheel
run: |
rm -fr ${{ github.workspace }}/dist/*