-
Notifications
You must be signed in to change notification settings - Fork 27
76 lines (64 loc) · 2.57 KB
/
release-draft.yml
File metadata and controls
76 lines (64 loc) · 2.57 KB
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
68
69
70
71
72
73
74
75
76
name: Release Draft
on:
workflow_dispatch: # checkov:skip=CKV_GHA_7
inputs:
bump-type:
description: Version bump type
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
pull-requests: write
jobs:
create-release-pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Read current version
id: current-version
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Bump version
id: bump-version
uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1.0.0
with:
current_version: ${{ steps.current-version.outputs.version }}
level: ${{ github.event.inputs.bump-type || 'patch' }}
- name: Write new version to VERSION
run: echo "${{ steps.bump-version.outputs.new_version }}" > VERSION
- name: Update package.json version
run: npm version "${{ steps.bump-version.outputs.new_version }}" --no-git-tag-version --allow-same-version
- name: Generate changelog from git history
id: changelog
uses: ROKT/rokt-workflows/actions/generate-changelog@main
with:
version: ${{ steps.bump-version.outputs.new_version }}
- name: Generate GitHub App token
id: generate-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ secrets.SDK_RELEASE_GITHUB_CLIENT_ID }}
private-key: ${{ secrets.SDK_RELEASE_GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
react-native-mparticle
- name: Create release PR
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1
with:
token: ${{ steps.generate-token.outputs.token }}
branch: release/${{ steps.bump-version.outputs.new_version }}
title: 'chore: release ${{ steps.bump-version.outputs.new_version }}'
body: |
## Release ${{ steps.bump-version.outputs.new_version }}
These files should have changed during the release, if they didn't then this is likely an issue and should be investigated:
- package.json
- CHANGELOG.md
${{ steps.changelog.outputs.release-notes }}
commit-message: 'chore: bump version to ${{ steps.bump-version.outputs.new_version }}'