-
Notifications
You must be signed in to change notification settings - Fork 9
84 lines (71 loc) · 2.95 KB
/
release-draft.yml
File metadata and controls
84 lines (71 loc) · 2.95 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
77
78
79
80
81
82
83
84
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
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
create-release-pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
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 README.md version references
run: |
sed -i "s/implementation 'com.mparticle:server-events-sdk:.*'/implementation 'com.mparticle:server-events-sdk:${{ steps.bump-version.outputs.new_version }}'/g" README.md
sed -i "s/<version>.*<\/version>/<version>${{ steps.bump-version.outputs.new_version }}<\/version>/g" README.md
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@f62c3c390716df5af712ba5d94f4f4a8efc1306d # v3.1.0
with:
tag: ${{ steps.bump-version.outputs.new_version }}
- name: Install JDK 17
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Smoke test - publish to Maven local
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }}
run: ./gradlew publishToMavenLocal -PVERSION=${{ steps.bump-version.outputs.new_version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
commit-message: "chore: prepare release ${{ steps.bump-version.outputs.new_version }}"
branch: release/${{ steps.bump-version.outputs.new_version }}
title: "chore: release ${{ steps.bump-version.outputs.new_version }}"
base: main
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:
- VERSION
- README.md
- CHANGELOG.md