Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Create release.yml #177

Merged
merged 2 commits into from
Sep 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/on-push-create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
name: Create new release
on:
push:
branches:
- main
paths:
- 'azureiai/**'
- 'setup.py'
- 'Partner_Ingestion_SwaggerDocument.json'
workflow_dispatch:

jobs:
CreateRelease:
runs-on: ubuntu-latest
steps:
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
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.old_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@v2.2.2
with:
python-version: 3.7

- name: Install dependencies
if: steps.tag_version.outputs.release_type
run: |
python -m pip install --upgrade pip
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