-
Notifications
You must be signed in to change notification settings - Fork 788
79 lines (70 loc) · 2.65 KB
/
release.yml
File metadata and controls
79 lines (70 loc) · 2.65 KB
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
72
73
74
75
76
77
78
79
name: Release Error Prone
on:
workflow_dispatch:
inputs:
version:
description: "version number for this release."
required: true
jobs:
build-maven-jars:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Set up JDK 25'
uses: actions/setup-java@v4
with:
java-version: 25
distribution: 'zulu'
cache: 'maven'
- name: 'Set up JDK 23'
uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'zulu'
cache: 'maven'
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
cache: 'maven'
server-id: central
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Bump Version Number
run: |
mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${GITHUB_EVENT_INPUTS_VERSION}"
git ls-files | grep 'pom.xml$' | xargs git add
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git commit -m "Release Error Prone ${GITHUB_EVENT_INPUTS_VERSION}"
git tag "v${GITHUB_EVENT_INPUTS_VERSION}"
echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV
git remote set-url origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/google/error-prone.git
env:
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
- name: Deploy to Sonatype
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run:
mvn --no-transfer-progress -P release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
- name: Push tag
run: |
git push origin "v${GITHUB_EVENT_INPUTS_VERSION}"
env:
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
- name: Draft Release Entry
uses: softprops/action-gh-release@v2.5.0
with:
draft: true
name: Error Prone ${{ github.event.input.version }}
generate_release_notes: true
tag_name: "v${{ github.event.inputs.version }}"
target_commitish: ${{ env.TARGET_COMMITISH }}