Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 18bd5cf

Browse files
authored
Create on-push-create-release.yml
1 parent 2ee47a9 commit 18bd5cf

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
name: Create new release
4+
on:
5+
workflow_call:
6+
secrets:
7+
PAT:
8+
required: false
9+
GITHUB_TOKEN:
10+
required: false
11+
12+
jobs:
13+
CreateRelease:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
with:
19+
token: ${{ secrets.PAT }}
20+
21+
- name: Bump version and push tag
22+
id: tag_version
23+
uses: mathieudutour/github-tag-action@v6.0
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
tag_prefix: "v"
27+
dry_run: true
28+
default_bump: false
29+
30+
- name: Set Configurations
31+
if: steps.tag_version.outputs.release_type
32+
shell: bash
33+
env:
34+
OLD_VERSION: ${{ steps.tag_version.outputs.previous_version }}
35+
VERSION: ${{ steps.tag_version.outputs.new_version }}
36+
run: sed -ri "s/$OLD_VERSION/$VERSION/" "setup.py" || exit 1
37+
38+
- uses: EndBug/add-and-commit@v9
39+
if: steps.tag_version.outputs.release_type
40+
with:
41+
message: Update Version to ${{ steps.tag_version.outputs.new_version }}
42+
committer_name: GitHub Actions
43+
committer_email: actions@github.com
44+
add: setup.py
45+
46+
- name: Setup Python
47+
if: steps.tag_version.outputs.release_type
48+
uses: actions/setup-python@v2.2.2
49+
with:
50+
python-version: 3.7
51+
52+
- name: Install dependencies
53+
if: steps.tag_version.outputs.release_type
54+
run: |
55+
python -m pip install --upgrade pip
56+
python -m pip install \
57+
setuptools \
58+
wheel \
59+
twine
60+
python setup.py sdist bdist_wheel
61+
62+
- uses: "marvinpinto/action-automatic-releases@latest"
63+
if: steps.tag_version.outputs.release_type
64+
with:
65+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
66+
automatic_release_tag: ${{ steps.tag_version.outputs.new_tag }}
67+
prerelease: false
68+
files: |
69+
LICENSE.md
70+
*.tar.gz
71+
*.whl

0 commit comments

Comments
 (0)