|
| 1 | +name: Release Microservices |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + projectToRelease: |
| 7 | + required: true |
| 8 | + type: choice |
| 9 | + options: |
| 10 | + - microservices/ |
| 11 | + - microservices/starters |
| 12 | + - microservices/starters/audit |
| 13 | + - microservices/starters/cache |
| 14 | + - microservices/starters/cached-results |
| 15 | + - microservices/starters/datawave |
| 16 | + - microservices/starters/metadata |
| 17 | + - microservices/starters/query |
| 18 | + - microservices/starters/query-metric |
| 19 | + - microservices/configcheck |
| 20 | + - microservices/microservice-parent |
| 21 | + - microservices/microservice-service-parent |
| 22 | + - microservices/services/accumulo/api |
| 23 | + - microservices/services/accumulo/service |
| 24 | + - microservices/services/audit/api |
| 25 | + - microservices/services/audit/service |
| 26 | + - microservices/services/authorization/api |
| 27 | + - microservices/services/authorization/service |
| 28 | + - microservices/services/config/ |
| 29 | + - microservices/services/dictionary/api |
| 30 | + - microservices/services/dictionary/service |
| 31 | + - microservices/services/file-provider/api |
| 32 | + - microservices/services/file-provider/service |
| 33 | + - microservices/services/hazelcast/client |
| 34 | + - microservices/services/hazelcast/common |
| 35 | + - microservices/services/hazelcast/service |
| 36 | + - microservices/services/mapreduce-query/api |
| 37 | + - microservices/services/mapreduce-query/jobs |
| 38 | + - microservices/services/mapreduce-query/layout-factory |
| 39 | + - microservices/services/mapreduce-query/service |
| 40 | + - microservices/services/modification/api |
| 41 | + - microservices/services/modification/service |
| 42 | + - microservices/services/query/api |
| 43 | + - microservices/services/query/service |
| 44 | + - microservices/services/query-executor/api |
| 45 | + - microservices/services/query-executor/service |
| 46 | + - microservices/services/query-metric/api |
| 47 | + - microservices/services/query-metric/service |
| 48 | + finalRelease: |
| 49 | + required: true |
| 50 | + default: false |
| 51 | + type: boolean |
| 52 | + description: "Whether or not this is the final release of this package. True will ignore modifier value and perform final release steps." |
| 53 | + modifier: |
| 54 | + required: true |
| 55 | + default: "RC1" |
| 56 | + description: "Modifier to add to version (e. g. 1.0.0-RC1)." |
| 57 | +env: |
| 58 | + JAVA_VERSION: '11' |
| 59 | + JAVA_DISTRIBUTION: 'zulu' #This is the default on v1 of the action for 1.8 |
| 60 | + MAVEN_OPTS: "-Djansi.force=true -Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true -XX:ThreadStackSize=1m" |
| 61 | + REGISTRY: ghcr.io |
| 62 | + USER_NAME: ${{ secrets.GHCR_WRITE_USER_NAME }} |
| 63 | + ACCESS_TOKEN: ${{ secrets.GHCR_WRITE_ACCESS_TOKEN }} |
| 64 | + |
| 65 | + |
| 66 | +jobs: |
| 67 | + release-microservice: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. |
| 70 | + permissions: |
| 71 | + contents: read |
| 72 | + packages: write |
| 73 | + steps: |
| 74 | + - name: Checkout DataWave |
| 75 | + uses: actions/checkout@v4 |
| 76 | + - name: Set up JDK ${{env.ACCUMULO_JAVA_VERSION}} |
| 77 | + uses: actions/setup-java@v4 |
| 78 | + with: |
| 79 | + distribution: ${{env.JAVA_DISTRIBUTION}} |
| 80 | + java-version: ${{env.JAVA_VERSION}} |
| 81 | + cache: 'maven' |
| 82 | + - name: Determine release version |
| 83 | + id: version |
| 84 | + run: | |
| 85 | + cd "${{ github.event.inputs.projectToRelease }}" |
| 86 | + RAW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) |
| 87 | + BASE_VERSION=${RAW_VERSION%-SNAPSHOT} |
| 88 | +
|
| 89 | + if [ "${{ github.event.inputs.finalRelease }}" = "true" ]; then |
| 90 | + FINAL_VERSION="$BASE_VERSION" |
| 91 | + # Bump patch for new dev version |
| 92 | + IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE_VERSION" |
| 93 | + NEXT_DEV_VERSION="$MAJOR.$MINOR.$((PATCH+1))-SNAPSHOT" |
| 94 | + else |
| 95 | + FINAL_VERSION="${BASE_VERSION}-${{ github.event.inputs.modifier }}" |
| 96 | + # Leave dev version as-is |
| 97 | + NEXT_DEV_VERSION="$RAW_VERSION" |
| 98 | + fi |
| 99 | +
|
| 100 | + echo "FINAL_VERSION=$FINAL_VERSION" >> $GITHUB_OUTPUT |
| 101 | + echo "NEXT_DEV_VERSION=$NEXT_DEV_VERSION" >> $GITHUB_OUTPUT |
| 102 | + echo "VERSION_TAG=${{ github.event.inputs.projectToRelease }}-$FINAL_VERSION" >> $GITHUB_OUTPUT |
| 103 | + - name: Release with Maven |
| 104 | + run: | |
| 105 | + cd "${{ github.event.inputs.projectToRelease }}" |
| 106 | + mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml --batch-mode release:prepare release:perform \ |
| 107 | + -DreleaseVersion="${{ steps.version.outputs.FINAL_VERSION }}" \ |
| 108 | + -DdevelopmentVersion="${{ steps.version.outputs.NEXT_DEV_VERSION }}" \ |
| 109 | + -Dtag="${{ steps.version.outputs.VERSION_TAG }}" \ |
| 110 | + -DpushChanges=true \ |
| 111 | + -DlocalCheckout=true |
| 112 | + - name: Build and Push packages and images |
| 113 | + run: | |
| 114 | + git checkout ${{ steps.version.outputs.VERSION_TAG }} |
| 115 | + cd "${{ github.event.inputs.projectToRelease }}" |
| 116 | + mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml \ |
| 117 | + --show-version \ |
| 118 | + --batch-mode \ |
| 119 | + --errors \ |
| 120 | + --no-transfer-progress \ |
| 121 | + --fail-at-end \ |
| 122 | + clean deploy \ |
| 123 | + -Pkubernetes \ |
| 124 | + -Dmaven.build.cache.enabled=false \ |
| 125 | + -Dtar \ |
| 126 | + -Ddeploy \ |
| 127 | + -Ddist \ |
| 128 | + -Ddocker-release \ |
| 129 | + -Dutils \ |
| 130 | + -Dservices \ |
| 131 | + -Dstarters \ |
| 132 | + -DskipTests \ |
| 133 | + -DskipFormat \ |
| 134 | + -DskipSpotbugs \ |
| 135 | + -Denforcer.skip=true \ |
| 136 | + -Dcheckstyle.skip=true \ |
| 137 | + -Dmicroservice-docker |
| 138 | +
|
| 139 | +
|
0 commit comments