forked from helidon-io/helidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fd0f91
commit a390b4e
Showing
143 changed files
with
5,201 additions
and
5,230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
# | ||
# 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: 'Common Job Steps' | ||
description: A composite action that abstracts the common steps needed to implement a job | ||
inputs: | ||
native-image: | ||
description: Whether to setup GraalVM native-image | ||
required: false | ||
default: 'false' | ||
maven-cache: | ||
description: Whether to cache the Maven local repository (read-only or read-write) | ||
required: false | ||
default: 'read-only' | ||
build-cache: | ||
description: Whether to cache the Maven build (read-only or read-write) | ||
required: false | ||
default: '' | ||
build-cache-id: | ||
description: Build cache id | ||
required: false | ||
default: 'default' | ||
GPG_PASSPHRASE: | ||
description: Value of the GPG_PASSPHRASE environment variable | ||
required: false | ||
default: '' | ||
GPG_PRIVATE_KEY: | ||
description: Value of the GPG_PRIVATE_KEY environment variable | ||
required: false | ||
default: '' | ||
MAVEN_SETTINGS: | ||
description: Value of the MAVEN_SETTINGS environment variable | ||
required: false | ||
default: '' | ||
run: | ||
description: The bash command to run | ||
required: true | ||
artifact-name: | ||
description: Name of the artifact to create | ||
required: false | ||
default: '' | ||
artifact-path: | ||
description: Path of the files to include in the artifact | ||
required: false | ||
default: '' | ||
test-artifact-name: | ||
description: Name of the test artifact to create (excluded on windows), if non empty tests are archived | ||
required: false | ||
default: '' | ||
free-space: | ||
description: Whether to aggressively free disk space on the runner | ||
default: 'false' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- if: ${{ inputs.free-space == 'true' }} | ||
# See https://github.com/actions/runner-images/issues/2840 | ||
name: Free disk space | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/local/share/powershell | ||
- if: ${{ runner.os == 'Windows' }} | ||
name: Use GNU tar | ||
shell: cmd | ||
run: | | ||
echo "Adding GNU tar to PATH" | ||
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Set up GraalVM | ||
if: ${{ inputs.native-image == 'true' }} | ||
uses: graalvm/setup-graalvm@v1.2.1 | ||
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
version: ${{ env.GRAALVM_VERSION }} | ||
components: ${{ env.GRAALVM_COMPONENTS }} | ||
check-for-updates: 'false' | ||
set-java-home: 'false' | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4.1.0 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Cache local Maven repository (read-write) | ||
if: ${{ inputs.maven-cache == 'read-write' }} | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
# See https://github.com/actions/toolkit/issues/713 | ||
# Include must not match top level directories | ||
path: | | ||
.m2/repository/**/*.* | ||
!.m2/repository/io/helidon/** | ||
enableCrossOsArchive: true | ||
# only hash top-level poms to keep it fast | ||
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }} | ||
restore-keys: | | ||
local-maven- | ||
- name: Cache local Maven repository (read-only) | ||
if: ${{ inputs.maven-cache == 'read-only' }} | ||
uses: actions/cache/restore@v4.0.2 | ||
with: | ||
path: | | ||
.m2/repository/**/*.* | ||
!.m2/repository/io/helidon/** | ||
enableCrossOsArchive: true | ||
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }} | ||
restore-keys: | | ||
local-maven- | ||
- name: Build cache (read-write) | ||
if: ${{ inputs.build-cache == 'read-write' }} | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
path: | | ||
./**/target/** | ||
.m2/repository/io/helidon/** | ||
enableCrossOsArchive: true | ||
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }} | ||
restore-keys: | | ||
build-cache-${{ github.run_id }}-${{ github.run_attempt }}- | ||
build-cache-${{ github.run_id }}- | ||
- name: Build cache (read-only) | ||
if: ${{ inputs.build-cache == 'read-only' }} | ||
uses: actions/cache/restore@v4.0.2 | ||
with: | ||
path: | | ||
./**/target/** | ||
.m2/repository/io/helidon/** | ||
enableCrossOsArchive: true | ||
fail-on-cache-miss: true | ||
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }} | ||
restore-keys: | | ||
build-cache-${{ github.run_id }}-${{ github.run_attempt }}- | ||
build-cache-${{ github.run_id }}- | ||
- name: Exec | ||
env: | ||
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }} | ||
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }} | ||
MAVEN_SETTINGS: ${{ inputs.MAVEN_SETTINGS }} | ||
MAVEN_ARGS: | | ||
${{ env.MAVEN_ARGS }} | ||
-Dmaven.repo.local=${{ github.workspace }}/.m2/repository | ||
-Dcache.record=${{ inputs.build-cache == 'read-write' }} | ||
run: ${{ inputs.run }} | ||
shell: bash | ||
- name: Archive test results | ||
# https://github.com/actions/upload-artifact/issues/240 | ||
if: ${{ inputs.test-artifact-name != '' && runner.os != 'Windows' && always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: 'ignore' | ||
name: ${{ inputs.test-artifact-name }} | ||
path: | | ||
**/target/surefire-reports/*.txt | ||
**/target/failsafe-reports/*.txt | ||
**/target/it/**/*.log | ||
- name: Archive artifacts | ||
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: 'ignore' | ||
name: ${{ inputs.artifact-name }} | ||
path: ${{ inputs.artifact-path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/setup-java@v4.1.0 | ||
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/setup-java@v4.1.0 | ||
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 }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }} | ||
RELEASE_WORKFLOW: "true" | ||
run: | | ||
git config user.email "helidon-robot_ww@oracle.com" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# 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: "Snapshot Release" | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
JAVA_VERSION: '21' | ||
JAVA_DISTRO: 'oracle' | ||
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: false | ||
|
||
jobs: | ||
deploy: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-20.04 | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
- uses: ./.github/actions/common | ||
with: | ||
MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }} | ||
build-cache: read-only | ||
run: etc/scripts/release.sh deploy_snapshot |
Oops, something went wrong.