|
17 | 17 | default: true |
18 | 18 | type: boolean |
19 | 19 |
|
20 | | -env: |
21 | | - MAVEN_FLAGS: "-B --no-transfer-progress" |
22 | | - MAVEN_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3" |
23 | | - |
24 | 20 | jobs: |
25 | 21 | release: |
26 | | - runs-on: ubuntu-latest |
27 | | - steps: |
28 | | - - name: Checkout code |
29 | | - if: github.event.inputs.perform_version == '' |
30 | | - uses: actions/checkout@v6 |
31 | | - - name: Checkout full repository |
32 | | - # Required when performing an existing release. |
33 | | - if: github.event.inputs.perform_version != '' |
34 | | - uses: actions/checkout@v6 |
35 | | - with: |
36 | | - fetch-depth: '0' |
37 | | - - name: Setup git user |
38 | | - env: |
39 | | - BUILD_USER: ${{ secrets.BUILD_USER }} |
40 | | - BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} |
41 | | - run: | |
42 | | - git config --global user.email "contact@killbill.io" |
43 | | - git config --global user.name "Kill Bill core team" |
44 | | - git config --global url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "git@github.com:" |
45 | | - - name: Configure Java |
46 | | - uses: actions/setup-java@v5 |
47 | | - with: |
48 | | - java-version: 21 |
49 | | - distribution: temurin |
50 | | - - name: Download Java dependencies |
51 | | - # We do as much as we can, but it may not be enough (https://issues.apache.org/jira/browse/MDEP-82) |
52 | | - run: | |
53 | | - mvn ${MAVEN_FLAGS} clean install dependency:resolve dependency:resolve-plugins -DskipTests=true -Dgpg.skip=true -Psonatype-oss-release |
54 | | - - name: Update killbill-oss-parent |
55 | | - if: github.event.inputs.parent_version != '' |
56 | | - run: | |
57 | | - echo "Updating killbill-oss-parent pom.xml to ${{ github.event.inputs.parent_version }}:" |
58 | | - mvn ${MAVEN_FLAGS} versions:update-parent -DgenerateBackupPoms=false -DparentVersion="[${{ github.event.inputs.parent_version }}]" |
59 | | - echo "killbill-oss-parent pom.xml changes:" |
60 | | - git --no-pager diff |
61 | | - echo "Downloading new dependencies:" |
62 | | - mvn ${MAVEN_FLAGS} -U clean install -DskipTests=true |
63 | | -
|
64 | | - git add pom.xml |
65 | | - # Will be pushed as part of the release process, only if the release is successful |
66 | | - git commit -m "pom.xml: update killbill-oss-parent to ${{ github.event.inputs.parent_version }}" |
67 | | - - name: Configure settings.xml for release |
68 | | - uses: actions/setup-java@v5 |
69 | | - with: |
70 | | - java-version: 21 |
71 | | - distribution: temurin |
72 | | - server-id: central |
73 | | - server-username: MAVEN_USERNAME |
74 | | - server-password: MAVEN_PASSWORD |
75 | | - gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} |
76 | | - gpg-passphrase: GPG_PASSPHRASE |
77 | | - - name: Release artifacts |
78 | | - if: github.event.inputs.perform_version == '' |
79 | | - env: |
80 | | - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} |
81 | | - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |
82 | | - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
83 | | - # It will still check the remote but hopefully not download much (0 B at 0 B/s). -o isn't safe because of MDEP-82 (see above). |
84 | | - run: | |
85 | | - mvn ${MAVEN_FLAGS} release:clean release:prepare release:perform |
86 | | - - name: Perform release |
87 | | - if: github.event.inputs.perform_version != '' |
88 | | - env: |
89 | | - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} |
90 | | - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |
91 | | - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
92 | | - # It will still check the remote but hopefully not download much (0 B at 0 B/s). -o isn't safe because of MDEP-82 (see above). |
93 | | - # See https://issues.apache.org/jira/browse/SCM-729 for why the release.properties file is required. |
94 | | - run: | |
95 | | - echo "scm.url=scm\:git\:git@github.com\:${GITHUB_REPOSITORY}.git" > release.properties |
96 | | - echo "scm.tag=${{ github.event.inputs.perform_version }}" >> release.properties |
97 | | - mvn ${MAVEN_FLAGS} release:perform |
98 | | - - name: Send Repository Dispatch Event |
99 | | - if: github.event.inputs.release_oss_parent == 'true' |
100 | | - env: |
101 | | - GH_TOKEN: ${{ secrets.GH_WORKFLOW_PAT }} |
102 | | - run: | |
103 | | - PROJECT_VERSION=$(git describe --abbrev=0 | cut -d '-' -f 4) |
104 | | - gh workflow -R killbill/killbill-oss-parent run release.yml -f base_plugin_version=${PROJECT_VERSION} |
| 22 | + uses: killbill/gh-actions-shared/.github/workflows/release.yml@main |
| 23 | + with: |
| 24 | + parent_version: ${{ github.event.inputs.parent_version }} |
| 25 | + perform_version: ${{ github.event.inputs.perform_version }} |
| 26 | + release_oss_parent: ${{ github.event.inputs.release_oss_parent }} |
| 27 | + oss_parent_dispatch_property: 'base_plugin_version' |
| 28 | + secrets: |
| 29 | + BUILD_USER: ${{ secrets.BUILD_USER }} |
| 30 | + BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} |
| 31 | + CLOUDSMITH_CENTRAL_PASSWORD: ${{ secrets.CLOUDSMITH_CENTRAL_PASSWORD }} |
| 32 | + CLOUDSMITH_KILLBILL_MAVEN_REPO_PASSWORD: ${{ secrets.CLOUDSMITH_KILLBILL_MAVEN_REPO_PASSWORD }} |
| 33 | + CLOUDSMITH_DISTRIBUTION_MAN_USERNAME: ${{ secrets.CLOUDSMITH_DISTRIBUTION_MAN_USERNAME }} |
| 34 | + CLOUDSMITH_DISTRIBUTION_MAN_PASSWORD: ${{ secrets.CLOUDSMITH_DISTRIBUTION_MAN_PASSWORD }} |
| 35 | + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} |
| 36 | + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
| 37 | + GH_WORKFLOW_PAT: ${{ secrets.GH_WORKFLOW_PAT }} |
0 commit comments