Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
- name: "Install JDK 11"
uses: actions/setup-java@v3
uses: actions/checkout@v4
- name: "Install JDK 17"
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "11"
java-version: "17"
cache: "gradle"
- name: "Run Tests"
run: ./gradlew test
81 changes: 81 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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
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
84 changes: 84 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release Publish

on:
push:
branches:
- main
paths:
- VERSION

permissions:
contents: write

jobs:
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JDK 17
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"

- name: Run tests
run: ./gradlew test

publish:
name: Publish to Maven Central
needs: unit-test
runs-on: ubuntu-latest
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }}
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Read version from VERSION
id: version
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Install JDK 17
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"

- name: Publish to Maven Central
run: ./gradlew publishMavenPublicationToSonatypeRepository -PVERSION=${{ steps.version.outputs.version }}

create-github-release:
name: Create GitHub Release
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Read version from VERSION
id: version
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Extract release notes from CHANGELOG.md
id: release-notes
uses: ffurrer2/extract-release-notes@273da39a24fb7db106a35526c8162815faffd31d # v3.1.0
with:
changelog_file: CHANGELOG.md

- name: Create GitHub Release
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
makeLatest: true
allowUpdates: true
tag: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body: ${{ steps.release-notes.outputs.release_notes }}
commit: ${{ github.sha }}
114 changes: 0 additions & 114 deletions .github/workflows/release.yml

This file was deleted.

89 changes: 0 additions & 89 deletions .scripts/maven.gradle

This file was deleted.

Loading
Loading