Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jul 15, 2022
1 parent e4854ff commit 8b8c6c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 223 deletions.
31 changes: 0 additions & 31 deletions .github/scripts/check_leak.sh

This file was deleted.

117 changes: 3 additions & 114 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,118 +24,7 @@ on:
schedule:
- cron: '30 8 * * 1' # At 08:30 on Monday, every Monday.

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240

jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Check out project
uses: actions/checkout@v2
with:
path: project

- name: Check out Netty core snapshot
uses: actions/checkout@v2
with:
repository: netty/netty
path: netty
ref: main # Netty core main branch for all Netty 5 targeting contrib repos.
fetch-depth: 1

# Configure Java
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'

- name: Build Netty Core
run: mvn install -B -T1C -q -am -pl :netty5-transport,:netty5-codec,:netty5-handler,:netty5-resolver-dns -DskipTests -Dcheckstyle.skip -Dxml.skip -Danimal.sniffer.skip -Djapicmp.skip -Drevapi.skip -Dmaven.javadoc.skip
working-directory: ./netty

# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Get Netty Core version
run: echo "netty_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
working-directory: ./netty

- name: Build Project
run: |
set -euo pipefail
mvn install -B -T1C -ntp -Pleak '-Dnetty.version=${{ env.netty_version }}' |& tee build-output.txt
working-directory: ./project

- name: Publish Test Reports
if: ${{ failure() }}
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: './project/**/target/surefire-reports/TEST-*.xml'
commit: ${{ github.event.workflow_run.head_commit.id }}
check_name: Test Reports

- name: Check for Leaks
if: ${{ always() }}
run: |
./project/.github/scripts/check_leak.sh ./project/build-output.txt
- name: Uploading Build Artifacts
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: artifacts
path: |
./project/**/target/surefire-reports/
./project/build-output.txt
**/hs_err*.log
CodeQL:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Check out project
uses: actions/checkout@v2
with:
path: project

- name: Check out Netty core snapshot
uses: actions/checkout@v2
with:
repository: netty/netty
path: netty
ref: main # Netty core main branch for all Netty 5 targeting contrib repos.
fetch-depth: 1

# Configure Java
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'

- name: Build Netty Core
run: mvn install -B -T1C -q -am -pl :netty5-transport,:netty5-codec,:netty5-handler,:netty5-resolver-dns -DskipTests -Dcheckstyle.skip -Dxml.skip -Danimal.sniffer.skip -Djapicmp.skip -Drevapi.skip -Dmaven.javadoc.skip
working-directory: ./netty

# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Get Netty Core version
run: echo "netty_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
working-directory: ./netty

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java

- name: Build Project
run: mvn compile -B -T1C -ntp -Dnetty.version=${{ env.netty_version }}
working-directory: ./project

- name: Remove Netty Core from Analysis
run: rm -fr ./netty

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Build:
uses: netty-contrib/.github/.github/workflows/ci-build.yml@main
secrets: inherit
97 changes: 19 additions & 78 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,26 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version being released (pom.xml files will be updated)'
required: true
description: 'The version being released (pom.xml files will be updated) - leave empty for Maven default'
required: false
type: string
default: ''
netty:
description: 'The version range to use for the Netty Core dependencies'
description: 'The version range to use for the Netty Core dependencies - will use value from pom.xml if empty'
required: false
type: string
default: ''
java-version:
description: 'The version of Java to use for building'
required: false
default: '(5.0,)'
type: string
default: '11'

jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Check out project
uses: actions/checkout@v2

# Configure Java
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Configure Git
run: |
git config user.name "Netty Project Bot on behalf of ${{ github.actor }}"
git config user.email "[email protected]"
- name: Configure Maven Release Repository
uses: s4u/maven-settings-action@v2
with:
servers: |
[{
"id": "sonatype-nexus",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Inspect Project
run: |
echo "netty_snapshot=$(mvn help:evaluate -Dexpression=netty.version -q -DforceStdout)" >> $GITHUB_ENV
echo "tag=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Set Netty Core Version
run: |
mvn versions:set-property -Dproperty=netty.version '-DnewVersion=${{ github.event.inputs.netty }}'
- name: Verify Build
run: |
mvn clean install -B -ntp -DperformRelease
- name: Update versions for release
run: |
git add .
git commit -m 'Update versions for release'
- name: Prepare release with Maven
run: mvn -B -ntp --file pom.xml release:prepare -DpreparationGoals=clean -DskipTests '-DreleaseVersion=${{ github.event.inputs.version }}' '-Dtag=${{ env.tag }}' -Drelease.gpg.keyname=${{ secrets.GPG_KEYNAME }} -Drelease.gpg.passphrase=${{ secrets.GPG_PASSPHRASE }}

- name: Perform release with Maven
run: mvn -B -ntp --file pom.xml release:perform -Drelease.gpg.keyname=${{ secrets.GPG_KEYNAME }} -Drelease.gpg.passphrase=${{ secrets.GPG_PASSPHRASE }}

- name: Prepare for next development version
run: |
mvn versions:set-property -Dproperty=netty.version '-DnewVersion=${{ env.netty_snapshot }}'
mvn versions:commit
git add .
git commit -m 'Update versions for development'
git push --tags
- name: Rollback release on failure
if: ${{ failure() }}
# Rollback the release in case of an failure
run: |
mvn -B -ntp --file pom.xml release:rollback
git push origin :"${{ env.tag }}"
Release:
uses: netty-contrib/.github/.github/workflows/release.yml@main
with:
version: ${{ inputs.version }}
netty: ${{ inputs.netty }}
java-version: ${{ inputs.java-version }}
secrets: inherit

0 comments on commit 8b8c6c7

Please sign in to comment.