Skip to content

Commit

Permalink
ShellCheck (#9078)
Browse files Browse the repository at this point in the history
- Add a new job to run shellcheck
- Fix existing scripts to pass the validation
- Remove unused scripts
- Inline some scripts in validate.yaml
  - etc/scripts/docs.sh
  - etc/scripts/github-build.sh
  - etc/scripts/github-compile.sh
  - etc/scripts/mp-tck.sh
  - etc/scripts/spotbugs.sh
  - etc/scripts/test-archetypes.sh
- Remove etc/scripts/BUILDDOCS.md (invalid)
- Update etc/scripts/RELEASE.md
- Move etc/scripts/actions/*.sh to etc/scripts
  • Loading branch information
romain-grecourt authored Aug 1, 2024
1 parent 34819f4 commit ad3d095
Show file tree
Hide file tree
Showing 47 changed files with 1,013 additions and 1,852 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign-issue-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: etc/scripts/actions/assign-issue-to-project.sh $GITHUB_REPOSITORY ${{ github.event.issue.number }} Backlog Triage
- run: etc/scripts/assign-issue-to-project.sh $GITHUB_REPOSITORY ${{ github.event.issue.number }} Backlog Triage
2 changes: 1 addition & 1 deletion .github/workflows/create-backport-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: etc/scripts/actions/create-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 }}
- run: etc/scripts/create-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 }}
80 changes: 70 additions & 10 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ name: "Validate"

on:
pull_request:
push:
branches-ignore: [ 'main', 'helidon-*.x' ]
workflow_call:

env:
JAVA_VERSION: '21'
JAVA_DISTRO: 'oracle'
HELIDON_PIPELINES: 'true'
MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3'
MAVEN_ARGS: |
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60
-Dmaven.wagon.http.retryHandler.count=3
concurrency:
group: Validate-${{ github.ref }}
Expand Down Expand Up @@ -47,6 +51,13 @@ jobs:
cache: maven
- name: Checkstyle
run: etc/scripts/checkstyle.sh
shellcheck:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: ShellCheck
run: etc/scripts/shellcheck.sh
spotbugs:
timeout-minutes: 45
runs-on: ubuntu-20.04
Expand All @@ -59,7 +70,12 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Spotbugs
run: etc/scripts/spotbugs.sh
run: |
mvn ${MAVEN_ARGS} -e \
-DskipTests \
-Dmaven.test.skip=true \
-Pspotbugs,pipeline \
install
docs:
timeout-minutes: 30
runs-on: ubuntu-20.04
Expand All @@ -72,7 +88,16 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Docs
run: etc/scripts/docs.sh
run: |
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
mvn ${MAVEN_ARGS} -e \
-f docs/pom.xml \
-Pjavadoc \
install
build:
timeout-minutes: 60
strategy:
Expand All @@ -88,7 +113,11 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Maven build
run: etc/scripts/github-build.sh
run: |
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.failure.ignore=false \
-Pjavadoc,sources,tests,pipeline \
install
examples:
timeout-minutes: 40
strategy:
Expand All @@ -112,9 +141,15 @@ jobs:
cache: maven
- name: Maven build
run: |
mvn -B -e "-Dmaven.test.skip=true" $MAVEN_HTTP_ARGS -DskipTests -Ppipeline install
cd examples
mvn -B verify
# prime build
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
mvn ${MAVEN_ARGS} -e \
-f examples/pom.xml \
verify
- name: Test quickstarts native image
run: etc/scripts/test-quickstarts.sh
mp-tck:
Expand All @@ -133,7 +168,17 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Maven build
run: etc/scripts/mp-tck.sh
run: |
# prime build
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
mvn ${MAVEN_ARGS} -e \
-f microprofile/tests/tck/pom.xml \
-Ptck-ft \
verify
archetypes:
timeout-minutes: 45
strategy:
Expand All @@ -149,7 +194,16 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Test archetypes
run: etc/scripts/test-archetypes.sh
run: |
# prime build
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
mvn ${MAVEN_ARGS} -e \
-f archetypes/pom.xml \
install
packaging:
timeout-minutes: 60
strategy:
Expand All @@ -166,7 +220,13 @@ jobs:
native-image-job-reports: true
cache: maven
- name: Build Helidon
run: etc/scripts/github-compile.sh
run: |
# prime build
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
- name: JAR packaging
run: etc/scripts/test-packaging-jar.sh
- name: JLink packaging
Expand Down
49 changes: 0 additions & 49 deletions etc/scripts/BUILDDOCS.md

This file was deleted.

108 changes: 52 additions & 56 deletions etc/scripts/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

# Releasing Helidon

These are the steps for doing a release of Helidon. These steps
will use release 0.7.0 in examples. Of course you are not releasing
will use release 0.7.0 in examples. Of course, you are not releasing
0.7.0, so make sure to change that release number to your release
number when copy/pasting.

# Overview
## Overview

The Helidon release pipeline is triggered when a change is pushed to
a branch that starts with `release-`. The release pipeline performs
Expand All @@ -21,16 +20,15 @@ is the overall flow:
5. Create GitHub release
6. Increment version in master and update changelog

# Steps in detail
## Steps in detail

```
```shell
# Set this to the version you are releasing
export VERSION="0.7.0"
```


1. Create local release branch
```
```shell
git clone git@github.com:oracle/helidon.git
git checkout -b release-${VERSION}
```
Expand Down Expand Up @@ -66,7 +64,7 @@ export VERSION="0.7.0"
1. Do quick smoke test by trying an archetype that is in the staging
repo (see staging repository profile at end of this document)

```
```shell
mvn -U archetype:generate -DinteractiveMode=false \
-DarchetypeGroupId=io.helidon.archetypes \
-DarchetypeArtifactId=helidon-quickstart-se \
Expand All @@ -81,87 +79,85 @@ export VERSION="0.7.0"
mvn package -Possrh-staging
```

2. Do full smoke test using test script (this requires staging profile to
be configured):
```
2. Do full smoke test using test script (this requires staging profile to be configured):
```shell
smoketest.sh --giturl=https://github.com/oracle/helidon.git --version=${VERSION} --clean --staged full
```
3. The smoketest script will leave its work in `/var/tmp/helidon-smoke.XXXX`.
Go there, into the quickstarts and test the native builds and Docker
builds (for Docker builds you'll need to update the pom to include
the staging repositories.
Go there, into the quickstarts and test the native builds and Docker builds.
For Docker builds you'll need to update the pom to include the staging repositories.
6. Release repository: Select repository then click Release (up at the top)
1. In description you can put something like "Helidon 0.7.0 Release"
7. Release repository: Select repository then click Release (up at the top)
1. In the description you can put something like "Helidon 0.7.0 Release"
2. It might take a while (possibly hours) before the release appears in Maven Central
3. To check on progress look at https://repo1.maven.org/maven2/io/helidon/helidon-bom/
6. Create GitHub release
8. Create GitHub release
1. Create a fragment of the change log that you want used for the release
description on the GitHub Releases page. Assume it is in `/tmp/change-frag.md`
2. Set your API key (you generate this on your GitHub Settings):
```
```shell
export GITHUB_API_KEY=<longhexnumberhere.....>
```
3. Run script to create release in GitHub:
```
```shell
etc/scripts/github-release.sh --changelog=/tmp/change-frag.md --version=${VERSION}
```
4. Go to https://github.com/oracle/helidon/releases and verify release looks like
you expect. You can edit it if you need to.
7. Update version and CHANGELOG in master
9. Update version and CHANGELOG in master
1. Create post release branch: `git checkout -b post-release-${VERSION}`
2. Copy CHANGELOG from your release branch. Add empty Unrelease section.
3. Update SNAPSHOT version number. Remember to use your version number!
```
```shell
etc/scripts/release.sh --version=0.7.1-SNAPSHOT update_version
```
If you perfromed a Milestone release you will likely leave the
SNAPSHOT version in master alone.
4. Add and commit changes then push
```
```shell
git push origin post-release-${VERSION}
```
5. Create PR and merge into master
8. Now go to helidon-site and look at the RELEASE.md there to release the website with updated docs
10. Now go to helidon-site and look at the RELEASE.md there to release the website with updated docs
# Staging Repository Profile
To pull artifacts from the sonatype staging repository add this profile to your `settings.xml`:
```
<profile>
<id>ossrh-staging</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>ossrh-staging</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>ossrh-staging</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
```xml
<profile>
<id>ossrh-staging</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>ossrh-staging</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>ossrh-staging</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
```
Loading

0 comments on commit ad3d095

Please sign in to comment.