Skip to content

Commit

Permalink
Update release
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-grecourt committed Aug 13, 2024
1 parent 6a6db03 commit 70c3e3b
Show file tree
Hide file tree
Showing 14 changed files with 274 additions and 167 deletions.
4 changes: 2 additions & 2 deletions .github/actions/common/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ runs:
if-no-files-found: 'ignore'
name: ${{ inputs.test-artifact-name }}
path: |
**/target/surefire-reports/*.txt
**/target/failsafe-reports/*.txt
**/target/surefire-reports/**
**/target/failsafe-reports/**
**/target/it/**/*.log
- name: Archive artifacts
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }}
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/assign-issue-to-project.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (c) 2021, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Assign Issue to Project

on:
issues:
types: [opened, reopened]
env:
GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}


jobs:
Assign-Issue-To-Backlog:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: etc/scripts/assign-issue.sh $GITHUB_REPOSITORY ${{ github.event.issue.number }} Backlog Triage
56 changes: 56 additions & 0 deletions .github/workflows/backport-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Copyright (c) 2022, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Create Backport Issues

on:
workflow_dispatch:
inputs:
issue:
description: 'Issue number'
required: true
version:
description: 'Helidon version this issue was reported for'
required: true
type: choice
options:
- 2.x
- 3.x
- 4.x
default: '2.x'
target-2:
type: boolean
description: 'Port to 2.x?'
default: false
target-3:
type: boolean
description: 'Port to 3.x?'
default: true
target-4:
type: boolean
description: 'Port to 4.x?'
default: true

env:
GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}


jobs:
Issue-Backport:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: etc/scripts/backport-issues.sh $GITHUB_REPOSITORY ${{ github.event.inputs.issue }} ${{ github.event.inputs.version }} ${{ github.event.inputs.target-2 }} ${{ github.event.inputs.target-3 }} ${{ github.event.inputs.target-4 }}
41 changes: 0 additions & 41 deletions .github/workflows/create-backport-issues.yml

This file was deleted.

16 changes: 14 additions & 2 deletions .github/workflows/pr-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#
# Workflow that runs on any push to main.
# Copyright (c) 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Post PR Merge"

Expand All @@ -18,5 +30,5 @@ jobs:
uses: ./.github/workflows/validate.yml
snapshot:
needs: validate
uses: ./.github/workflows/snapshotrelease.yaml
uses: ./.github/workflows/snapshot.yaml
secrets: inherit
76 changes: 42 additions & 34 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,74 @@
# Notes
# - cannot run on Windows, as we use shell scripts
#
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Release"

on:
push:
branches:
- 'release-*'
branches: [ 'release-*' ]

env:
JAVA_VERSION: '21'
JAVA_DISTRO: 'oracle'
MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3'
MAVEN_ARGS: |
-B -e
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60
-Dmaven.wagon.http.retryHandler.count=3
-Djdk.toolchain.version=${JAVA_VERSION}
concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
copyright:
timeout-minutes: 10
create-tag:
runs-on: ubuntu-20.04
environment: release
outputs:
tag: ${{ steps.create-tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ env.JAVA_VERSION }}
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Copyright
run: etc/scripts/copyright.sh
- id: create-tag
run: ./etc/scripts/release.sh create_tag >> "${GITHUB_OUTPUT}"
validate:
needs: create-tag
uses: ./.github/workflows/validate.yml
with:
ref: ${{ needs.create-tag.outputs.tag }}
release:
timeout-minutes: 60
needs: [ create-tag, validate ]
runs-on: ubuntu-20.04
timeout-minutes: 30
environment: release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
fetch-depth: '0'
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/[email protected]
ref: ${{ needs.create-tag.outputs.tag }}
- uses: ./.github/actions/common
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Release
env:
GPG_PASSPHRASE: ${{ secrets.HELIDON_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.HELIDON_GPG_PRIVATE_KEY }}
GPG_PUBLIC_KEY: ${{ secrets.HELIDON_GPG_PUBLIC_KEY }}
MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }}
RELEASE_WORKFLOW: "true"
run: |
git config user.email "[email protected]"
git config user.name "Helidon Robot"
etc/scripts/release.sh release_build
- name: Upload Staged Artifacts
uses: actions/upload-artifact@v4
with:
name: io-helidon-artifacts-${{ github.ref_name }}
path: parent/target/nexus-staging/
retention-days: 90
build-cache: read-only
artifact-name: io-helidon-artifacts-${{ github.ref_name }}
artifact-path: target/nexus-staging/
run: etc/scripts/release.sh release_build
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Perform a snapshot build and deploy to snapshot repository
# Notes
# - cannot run on Windows, as we use shell scripts
#
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Snapshot Release"

Expand Down
5 changes: 0 additions & 5 deletions .mvn/cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
<include>tests/integration/packaging/**</include>
</includes>
</moduleSet>
<moduleSet name="jpa">
<includes>
<include>tests/integration/packaging/**</include>
</includes>
</moduleSet>
<moduleSet name="it">
<includes>
<include>tests/integration/**</include>
Expand Down
File renamed without changes.
File renamed without changes.
36 changes: 19 additions & 17 deletions etc/scripts/build-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# limitations under the License.
#

# Build helidon examples, cloning the examples repository if needed

set -o pipefail || true # trace ERR through pipes
set -o errtrace || true # trace ERR through commands and functions
set -o errexit || true # exit the script if any statement returns a non-true return value
Expand All @@ -43,31 +41,35 @@ readonly SCRIPT_PATH
WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)
readonly WS_DIR

# If needed we clone the helidon-examples repo into a subdirectory of the helidon repository
readonly HELIDON_EXAMPLES_PATH=${WS_DIR}/helidon-examples
version() {
awk 'BEGIN {FS="[<>]"} ; /<helidon.version>/ {print $3; exit 0}' "${1}"
}

HELIDON_VERSION=$(version "${WS_DIR}/bom/pom.xml")
readonly HELIDON_VERSION

# If needed we clone the helidon-examples repo
if [ ! -d "${WS_DIR}/helidon-examples" ]; then
echo "Cloning examples repository into ${WS_DIR}/helidon-examples"
git clone --branch dev-4.x --single-branch https://github.com/helidon-io/helidon-examples.git "${WS_DIR}/helidon-examples"
fi

version() {
# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} -B -N -f "${1}" -Dexpression=helidon.version help:evaluate | grep -v '\[INFO\]'
}

# Make sure the helidon version from the example repo aligns with this repository
HELIDON_VERSION_IN_THIS_REPO=$(version "${WS_DIR}/pom.xml")
readonly HELIDON_VERSION_IN_THIS_REPO
# If in a tag, update the version on the fly
if [ -n "$(git tag --points-at HEAD)" ] ; then
export TMPDIR=/tmp # FIXME remove tmp hack
"${WS_DIR}/helidon-examples"/etc/scripts/updatehelidonversion.sh "${HELIDON_VERSION}"
fi
fi

HELIDON_VERSION_IN_EXAMPLES=$(version "${WS_DIR}/helidon-examples/pom.xml")
readonly HELIDON_VERSION_IN_EXAMPLES

if [ "${HELIDON_VERSION_IN_THIS_REPO}" != "${HELIDON_VERSION_IN_EXAMPLES}" ]; then
# Make sure the helidon version from the example repo aligns with this repository
if [ "${HELIDON_VERSION}" != "${HELIDON_VERSION_IN_EXAMPLES}" ]; then
printf "The Helidon version in this repository (%s) does not match the Helidon version in %s (%s)\n" \
"${HELIDON_VERSION_IN_THIS_REPO}" \
"${HELIDON_EXAMPLES_PATH}" \
"${HELIDON_VERSION}" \
"${WS_DIR}/helidon-examples" \
"${HELIDON_VERSION_IN_EXAMPLES}"
exit 78
exit 1
fi

# shellcheck disable=SC2086
Expand Down
Loading

0 comments on commit 70c3e3b

Please sign in to comment.