Skip to content

Commit 9fd7d28

Browse files
committed
ci: add pre-release workflow
1 parent 70363fc commit 9fd7d28

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/prerelease.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Pre-release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*-alpha.*'
7+
- '*-beta.*'
8+
- '*-rc.*'
9+
10+
jobs:
11+
Prerelease:
12+
name: 🚀 Pre-release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Extract version from tag
20+
run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
21+
22+
- name: Setup JDK 17
23+
uses: actions/setup-java@v5.1.0
24+
with:
25+
distribution: 'corretto'
26+
java-version: '17'
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v4
30+
31+
- name: Publish to MavenCentral
32+
run: |
33+
./gradlew publishToSonatype --no-daemon --max-workers 1 closeAndReleaseSonatypeStagingRepository
34+
env:
35+
STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
36+
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
37+
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
38+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
39+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
40+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
41+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
42+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
43+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
44+
45+
- name: Create pre-release on GitHub
46+
uses: ncipollo/release-action@v1
47+
with:
48+
tag: ${{ env.VERSION }}
49+
prerelease: true
50+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
script: |
2222
// Getting the release version from the PR source branch
2323
// Source branch looks like this: release-1.0.0
24-
const version = context.payload.pull_request.head.ref.split('-')[1]
24+
const version = context.payload.pull_request.head.ref.replace(/^release-/, '')
2525
core.exportVariable('VERSION', version)
2626
2727
- name: Setup JDK 17

0 commit comments

Comments
 (0)