This repository was archived by the owner on Mar 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
69 lines (62 loc) · 2.01 KB
/
on-push-create-release.yml
File metadata and controls
69 lines (62 loc) · 2.01 KB
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
name: Create new release
on:
workflow_call:
secrets:
PAT:
required: false
jobs:
CreateRelease:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.PAT }}
tag_prefix: "v"
dry_run: true
default_bump: false
- name: Set Configurations
if: steps.tag_version.outputs.release_type
shell: bash
env:
OLD_VERSION: ${{ steps.tag_version.outputs.previous_version }}
VERSION: ${{ steps.tag_version.outputs.new_version }}
run: sed -ri "s/$OLD_VERSION/$VERSION/" "setup.py" || exit 1
- uses: EndBug/add-and-commit@v9
if: steps.tag_version.outputs.release_type
with:
message: Update Version to ${{ steps.tag_version.outputs.new_version }}
committer_name: GitHub Actions
committer_email: actions@github.com
add: setup.py
- name: Setup Python
if: steps.tag_version.outputs.release_type
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
if: steps.tag_version.outputs.release_type
run: |
python -m pip install --upgrade pip
python -m pip install \
setuptools \
wheel \
twine
python setup.py sdist bdist_wheel
- uses: "marvinpinto/action-automatic-releases@latest"
if: steps.tag_version.outputs.release_type
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.tag_version.outputs.new_tag }}
prerelease: false
files: |
LICENSE.md
*.tar.gz
*.whl