|
1 | | -# Notes |
2 | | -# - cannot run on Windows, as we use shell scripts |
| 1 | +# |
| 2 | +# Copyright (c) 2023, 2024 Oracle and/or its affiliates. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
3 | 15 |
|
4 | 16 | name: "Release" |
5 | 17 |
|
6 | 18 | on: |
7 | 19 | push: |
8 | | - branches: |
9 | | - - 'release-*' |
| 20 | + branches: [ 'release-*' ] |
| 21 | + |
10 | 22 | env: |
11 | 23 | JAVA_VERSION: '21' |
12 | 24 | JAVA_DISTRO: 'oracle' |
13 | | - MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3' |
| 25 | + MAVEN_ARGS: | |
| 26 | + -B -e |
| 27 | + -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 |
| 28 | + -Dmaven.wagon.http.retryHandler.count=3 |
| 29 | + -Djdk.toolchain.version=${JAVA_VERSION} |
| 30 | + -Dcache.enabled=true |
14 | 31 |
|
15 | 32 | concurrency: |
16 | 33 | group: release-${{ github.workflow }}-${{ github.ref }} |
17 | 34 | cancel-in-progress: true |
18 | 35 |
|
19 | 36 | jobs: |
20 | | - copyright: |
21 | | - timeout-minutes: 10 |
| 37 | + create-tag: |
22 | 38 | runs-on: ubuntu-20.04 |
| 39 | + environment: release |
| 40 | + outputs: |
| 41 | + version: ${{ steps.create-tag.outputs.version }} |
| 42 | + tag: ${{ steps.create-tag.outputs.tag }} |
23 | 43 | steps: |
24 | 44 | - uses: actions/checkout@v4 |
25 | 45 | with: |
26 | | - fetch-depth: 0 |
27 | | - - name: Set up JDK ${{ env.JAVA_VERSION }} |
28 | | - uses: actions/setup-java@v4.1.0 |
29 | | - with: |
30 | | - distribution: ${{ env.JAVA_DISTRO }} |
31 | | - java-version: ${{ env.JAVA_VERSION }} |
32 | | - cache: maven |
33 | | - - name: Copyright |
34 | | - run: etc/scripts/copyright.sh |
35 | | - release: |
36 | | - timeout-minutes: 60 |
| 46 | + fetch-depth: '0' |
| 47 | + token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }} |
| 48 | + - id: create-tag |
| 49 | + run: ./etc/scripts/release.sh create_tag >> "${GITHUB_OUTPUT}" |
| 50 | + validate: |
| 51 | + needs: create-tag |
| 52 | + uses: ./.github/workflows/validate.yml |
| 53 | + with: |
| 54 | + ref: ${{ needs.create-tag.outputs.tag }} |
| 55 | + stage: |
| 56 | + needs: [ create-tag, validate ] |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + moduleSet: [ core, integrations, others ] |
37 | 60 | runs-on: ubuntu-20.04 |
| 61 | + timeout-minutes: 30 |
38 | 62 | environment: release |
39 | 63 | steps: |
40 | 64 | - uses: actions/checkout@v4 |
41 | 65 | with: |
42 | | - token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }} |
43 | 66 | fetch-depth: '0' |
44 | | - - name: Set up JDK ${{ env.JAVA_VERSION }} |
45 | | - uses: actions/setup-java@v4.1.0 |
| 67 | + ref: ${{ needs.create-tag.outputs.tag }} |
| 68 | + - uses: actions/download-artifact@v4 |
46 | 69 | with: |
47 | | - distribution: ${{ env.JAVA_DISTRO }} |
48 | | - java-version: ${{ env.JAVA_VERSION }} |
49 | | - cache: maven |
50 | | - - name: Release |
| 70 | + pattern: "{javadoc-jars-${{ matrix.moduleSet }},docs}" |
| 71 | + merge-multiple: true |
| 72 | + - shell: bash |
51 | 73 | env: |
52 | 74 | GPG_PASSPHRASE: ${{ secrets.HELIDON_GPG_PASSPHRASE }} |
53 | 75 | GPG_PRIVATE_KEY: ${{ secrets.HELIDON_GPG_PRIVATE_KEY }} |
54 | | - GPG_PUBLIC_KEY: ${{ secrets.HELIDON_GPG_PUBLIC_KEY }} |
55 | | - MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }} |
56 | | - RELEASE_WORKFLOW: "true" |
| 76 | + run: etc/scripts/setup-gpg.sh |
| 77 | + - uses: ./.github/actions/common |
| 78 | + with: |
| 79 | + build-cache: read-only |
| 80 | + artifact-name: io-helidon-artifacts-part-${{ matrix.moduleSet }} |
| 81 | + artifact-path: staging |
| 82 | + run: | |
| 83 | + mvn ${MAVEN_ARGS} \ |
| 84 | + -DreactorRule=default \ |
| 85 | + -DmoduleSet=${{ matrix.moduleSet }} \ |
| 86 | + -Dcache.loadSuffixes=javadoc,docs \ |
| 87 | + -Prelease,no-snapshots \ |
| 88 | + -DskipTests \ |
| 89 | + -DaltDeploymentRepository=":::file://${PWD}/staging" \ |
| 90 | + deploy |
| 91 | + deploy: |
| 92 | + needs: [ create-tag, stage ] |
| 93 | + runs-on: ubuntu-24.04 |
| 94 | + timeout-minutes: 20 |
| 95 | + environment: release |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v4 |
| 98 | + with: |
| 99 | + fetch-depth: '0' |
| 100 | + ref: ${{ needs.create-tag.outputs.tag }} |
| 101 | + - uses: actions/download-artifact@v4 |
| 102 | + with: |
| 103 | + pattern: io-helidon-artifacts-part-* |
| 104 | + path: staging |
| 105 | + merge-multiple: true |
| 106 | + - shell: bash |
| 107 | + env: |
| 108 | + NEXUS_USER: ${{ secrets.NEXUS_USER }} |
| 109 | + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} |
57 | 110 | run: | |
58 | | - git config user.email "helidon-robot_ww@oracle.com" |
59 | | - git config user.name "Helidon Robot" |
60 | | - etc/scripts/release.sh release_build |
61 | | - - name: Upload Staged Artifacts |
62 | | - uses: actions/upload-artifact@v4 |
| 111 | + etc/scripts/nexus.sh deploy_release \ |
| 112 | + --dir="staging" \ |
| 113 | + --description="Helidon v%{version}" |
| 114 | + - uses: actions/upload-artifact@v4 |
63 | 115 | with: |
64 | | - name: io-helidon-artifacts-${{ github.ref_name }} |
65 | | - path: parent/target/nexus-staging/ |
66 | | - retention-days: 90 |
| 116 | + name: io-helidon-artifacts-${{ needs.create-tag.outputs.version }} |
| 117 | + path: staging |
0 commit comments