-
Notifications
You must be signed in to change notification settings - Fork 29
71 lines (68 loc) · 2.93 KB
/
release.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
workflow_dispatch:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
environment: deployment
steps:
- uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-core-
- name: Publish release to sonatype
run: ./gradlew publishToSonatype -Prelease closeAndReleaseSonatypeStagingRepository
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}
# - name: Create pull request into develop
# uses: repo-sync/pull-request@v2
# with:
# source_branch: 'main'
# destination_branch: 'develop'
# github_token: ${{ secrets.PAT }}
# pr_title: "chore(release): pulling main into develop post release v${{ steps.extract-version.outputs.release_version }}"
# pr_body: ':crown: *An automated PR*'
# pr_reviewer: 'itsdebs'
#
# - name: Delete hotfix release branch
# uses: koj-co/delete-merged-action@master
# if: startsWith(github.event.pull_request.head.ref, 'hotfix-release/')
# with:
# branches: 'hotfix-release/*'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Delete release branch
# uses: koj-co/delete-merged-action@master
# if: startsWith(github.event.pull_request.head.ref, 'release/')
# with:
# branches: 'release/*'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: create release
# run: |
# curl \
# -X POST \
# -H "Authorization: token $RELEASE_TOKEN" \
# https://api.github.com/repos/${{github.repository}}/releases \
# -d '{"tag_name": "${{ env.RELEASE_VERSION }}", "name": "${{ env.RELEASE_VERSION }}", "body": "Release of version ${{ env.RELEASE_VERSION }}", "draft": false, "prerelease": false, "generate_release_notes": true}'
# env:
# RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# RELEASE_VERSION: ${{ steps.vars.outputs.tag }}