Skip to content

Commit

Permalink
add ci pipelines (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrrypg authored Sep 2, 2022
1 parent 0c97267 commit 5937987
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 11 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bump version
on:
push:
branches:
- main
jobs:
bumpversion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag_version.outputs.new_version }}
previous_tag: ${{ steps.tag_version.outputs.previous_tag }}
bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEDALO_PAT }}
- name: Get next version
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Create bumpversion
if: steps.tag_version.outputs.new_version
run: |
pip install bumpversion
bumpversion --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg
- name: Update Changelog
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/[email protected]
with:
latest-version: ${{ steps.tag_version.outputs.new_tag }}
release-notes: ${{ steps.tag_version.outputs.changelog }}
- name: Commit bumpversion
id: bumpversion
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/[email protected]
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_version }}"
file_pattern: setup.cfg CHANGELOG.md tvm/*
release:
needs: bumpversion
if: needs.bumpversion.outputs.version
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEDALO_PAT }}
- name: Create tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }}
default_bump: false
default_prerelease_bump: false
- name: Create a GitHub release
if: steps.tag_version.outputs.new_tag
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: true
25 changes: 25 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: labeler

on:
pull_request:
branches:
- 'main'

jobs:
labeler:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: CodelyTV/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
fail_if_xl: 'true'
message_if_xl: >
'This PR exceeds the recommended size of 1000 lines.
Please make sure you are NOT addressing multiple issues with one PR.
Note this PR might be rejected due to its size.'
github_api_url: 'api.github.com'
14 changes: 8 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Change Log
# Changelog
All notable changes to this project will be documented in this file.

## Unreleased
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [2.0.1] - 2022-08-25
## [2.0.1] - 2022-08-25

#### Changed
### Changed

- Add virtualenv to requirements
### [2.0.0] - 2022-08-10
## [2.0.0] - 2022-08-10

#### Changed
### Changed

- **BREAKING CHANGE:** Migrate environment manager project init command to clean architecture.
- **BREAKING CHANGE:** Migrate version manager commands to clean architecture.
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[bumpversion]
current_version = 2.0.1
commit = True
message = docs(bumpversion): {current_version} → {new_version}
tag = True
commit = False
tag = False

[bumpversion:file:tvm/__init__.py]

Expand Down
2 changes: 1 addition & 1 deletion tvm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import stat
import subprocess
import sys
from distutils.version import LooseVersion
from distutils.version import LooseVersion # pylint: disable=W0402
from typing import Optional

import click
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pathlib
import shutil
import subprocess
from distutils.dir_util import copy_tree
from distutils.dir_util import copy_tree # pylint: disable=W0402
from typing import List

from tvm.environment_manager.domain.environment_manager_repository import EnvironmentManagerRepository
Expand Down

0 comments on commit 5937987

Please sign in to comment.