Skip to content

Commit 73caacf

Browse files
author
Edoardo Holzl
committed
Add version number and action for release
1 parent 421014e commit 73caacf

3 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This is a basic workflow that is manually triggered
2+
3+
name: Create a new MLBench release
4+
5+
# Controls when the action will run. Workflow runs when manually triggered using the UI
6+
# or API.
7+
on:
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
patch:
12+
# Friendly description to be shown in the UI instead of 'name'
13+
description: 'Patch [major].[minor].[patch]-[dev]'
14+
# Input has to be provided for the workflow to run
15+
required: true
16+
futureRelease:
17+
description: 'Future release Number'
18+
required: true
19+
20+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
21+
jobs:
22+
# This workflow contains a single job called "greet"
23+
create-release:
24+
# The type of runner that the job will run on
25+
runs-on: ubuntu-latest
26+
27+
# Steps represent a sequence of tasks that will be executed as part of the job
28+
steps:
29+
# Create release branch
30+
- name: Create Release Branch
31+
uses: peterjgrainger/action-create-branch@v2.0.1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
branch: release/v${{ github.event.inputs.futureRelease}}
36+
# Checkout Branch
37+
- name: Checkout release branch
38+
uses: actions/checkout@v2.3.4
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
ref: release/v${{ github.event.inputs.futureRelease}}
43+
# Bump version
44+
- name: setup python
45+
uses: actions/setup-python@v2
46+
with:
47+
python-version: 3.7
48+
- name: Bump version
49+
run: pip install bumpversion && bumpversion --allow-dirty --no-tag --no-commit ${{ github.event.inputs.patch }}
50+
# Generate changelog
51+
- name: Find Latest Tag
52+
# You may pin to the exact commit or the version.
53+
# uses: oprypin/find-latest-tag@cc85180adff5be91282940868529accfc5ab40a7
54+
uses: oprypin/find-latest-tag@v1.0.4
55+
with:
56+
repository: mlbench/mlbench-dashboard
57+
id: previousTag
58+
- name: Generate Changelog using github-changelog-generator
59+
# You may pin to the exact commit or the version.
60+
# uses: faberNovel/github-changelog-generator-action@5fcc510347703c66014a0d54c2c6dfb6c1851eaa
61+
uses: faberNovel/github-changelog-generator-action@v1.0.0-alpha02
62+
with:
63+
options: -u mlbench -p mlbench-dashboard -t ${{ secrets.GITHUB_TOKEN }} \
64+
--release-branch release/v${{ github.event.inputs.futureRelease}} --future-release v${{ github.event.inputs.futureRelease }} \
65+
--since-tag ${{ steps.previousTag.outputs.tag }} --base CHANGELOG.md
66+
- name: Commit Changes
67+
uses: stefanzweifel/git-auto-commit-action@v4.7.2
68+
with:
69+
commit_message: 'Bump version and update Changelog'
70+

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2.4.1

setup.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 2.4.1
3+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-dev(?P<dev>[0-9]+))?
4+
serialize =
5+
{major}.{minor}.{patch}-dev{dev}
6+
{major}.{minor}.{patch}
7+
commit = False
8+
tag = False
9+
10+
[bumpversion:file:VERSION]
11+
search = v{current_version}
12+
replace = v{new_version}

0 commit comments

Comments
 (0)