-
Notifications
You must be signed in to change notification settings - Fork 348
47 lines (39 loc) · 1.38 KB
/
release-code.yml
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
name: Release Code
on:
release:
types: [ published ]
jobs:
release-code:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.repository == 'ExpediaGroup/graphql-kotlin'
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Build library with Gradle
run: ./gradlew clean build
- name: Publish library with Gradle
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository publishPlugins -Pversion=${NEW_VERSION}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
PLUGIN_PORTAL_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
PLUGIN_PORTAL_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- name: Archive failure build reports
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-reports
path: |
./**/build/reports
retention-days: 7