-
Notifications
You must be signed in to change notification settings - Fork 29
67 lines (57 loc) · 2.24 KB
/
create-release-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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@v4
with:
fetch-depth: 0
- name: Setup CML
uses: iterative/setup-cml@v1
- name: Set Variables
id: set_variables
run: |
echo "last_release_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
echo "release_date=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
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 "new_version=$(cat extension/package.json | jq -r .version)" >> $GITHUB_OUTPUT
- 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
run: |
cml pr create \
--token="${{ secrets.GITHUB_TOKEN }}" \
--message="Update version and CHANGELOG for release" \
--title="Update version and CHANGELOG for release" \
--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).
**The `publish` workflow will run automatically when this PR is merged.**
' .