-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add create release pr workflow (#1685)
* add create release action * rename workflow * use a real version of the builder * get version from bash command * give action access to create a PR * add body and commit message * add message into PR description to close and reopen PR for merge checks * correctly set variables in step * remove workflow test
- Loading branch information
1 parent
8c98d02
commit 2587b61
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "### 🚀 New Features and Enhancements", | ||
"labels": ["product"] | ||
}, | ||
{ | ||
"title": "### 🐛 Bug Fixes", | ||
"labels": ["bug"] | ||
}, | ||
{ | ||
"title": "### 🔨 Maintenance", | ||
"labels": ["🏠 housekeeping"] | ||
} | ||
], | ||
"pr_template": "- ${{TITLE}} [#${{NUMBER}}](https://github.com/iterative/vscode-dvc/pull/${{NUMBER}}) by [@${{AUTHOR}}](https://github.com/${{AUTHOR}})" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Create Release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
override_version: | ||
description: | ||
'Override semver - can be used to bump minor and major versions' | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Variables | ||
id: set_variables | ||
run: | | ||
echo "::set-output name=last_release_tag::$(git describe --tags --abbrev=0)" | ||
echo "::set-output name=release_date::$(date --rfc-3339=date)" | ||
- name: Build Changelog | ||
id: build_changelog | ||
uses: mikepenz/release-changelog-builder-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
configuration: .github/workflows/changelog-config.json | ||
toTag: main | ||
fromTag: ${{ steps.set_variables.outputs.last_release_tag }} | ||
|
||
- name: Update Version | ||
id: update_version | ||
run: | | ||
OVERRIDE_VERSION=${{ github.event.inputs.override_version }} | ||
yarn workspace dvc version --new-version ${OVERRIDE_VERSION:-patch} --no-git-tag-version | ||
echo "::set-output name=new_version::$(cat extension/package.json | jq -r .version)" | ||
- name: Update Changelog | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
latest-version: '[${{ steps.update_version.outputs.new_version }}]' | ||
release-notes: ${{ steps.build_changelog.outputs.changelog }} | ||
release-date: ${{ steps.set_variables.outputs.release_date }} | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
base: main | ||
body: | | ||
This PR updates the extension version and CHANGELOG.md. | ||
Please close and reopen this PR to run the required workflows (Required statuses must pass before merging). | ||
**This needs to be approved and merged before we run the `publish` workflow.** | ||
commit-message: 'update version and changelog for release' | ||
title: 'Update version and CHANGELOG for release' | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters