-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 2.09 KB
/
release-sdk.yaml
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
name: Release SDK to Maven Central
on:
workflow_dispatch:
inputs:
version:
description: |
The version to release.
Add -SNAPSHOT to release a snapshot version.
default: '0.0.1-SNAPSHOT'
jobs:
release-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
server-id: oss-sonatype
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
settings-path: ${{ github.workspace }}
- name: Prepare Environment and Version
id: prepare
run: |
git config user.name s-github-actions
git config user.email [email protected]
echo "branch_name=release/${{ inputs.version }}" >> $GITHUB_OUTPUT
- name: Prepare Release
id: prepare_release
run: |
cd code
chmod a+x ../gradlew && ../gradlew --no-daemon versionsSet -Pversion=${{ inputs.version }}
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
branch: "publish-v${{ inputs.version }}"
commit-message: "chore: prepare release ${{ inputs.version }}"
title: "chore: Publish v${{ inputs.version }}"
body: |
This PR updates the version of the SDK to v`${{ inputs.version }}`.
Generated by the EG SDK generator.
add-paths: |
code/*
- name: Publish
env:
ARTYLAB_USER: ${{ secrets.SONATYPE_USERNAME }}
ARTYLAB_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
run: |
echo "Publishing version ${{ inputs.version }}"
cd code
../gradlew publish -Pversion=${{ inputs.version }}