Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve and simplify the releng infrastructure #568

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 8 additions & 4 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17' ]
java: [ '17' ]
name: Java ${{ matrix.java }} compile
steps:
- uses: actions/checkout@v2
Expand All @@ -27,10 +27,14 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build Stable Widgets
- name: Set up Maven
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
with:
maven-version: 3.9.6
- name: Build All Widgets
run: xvfb-run mvn -V clean verify -Dtycho.localArtifacts=ignore
- name: Build Incubation Widgets
run: xvfb-run mvn -V clean verify -Pincubation -Dtycho.localArtifacts=ignore
# - name: Build Incubation Widgets
# run: xvfb-run mvn -V clean verify -Pincubation -Dtycho.localArtifacts=ignore
# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action@v1
# if: always()
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ target/
class/
*.class
.metadata/
releng/org.eclipse.nebula.site/updates/
build.log
10 changes: 5 additions & 5 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<extensions>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<version>2.5.0</version>
</extension>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>4.0.4</version>
</extension>
</extensions>
22 changes: 22 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.nebula</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
<filteredResources>
<filter>
<id>1707305303744</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-true-true-(examples/org.eclipse.nebula.examples.*|widgets/(opal/)?[^/]+/org.eclipse.nebula.*|releng/org.eclipse.nebula.*)/.*</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
145 changes: 145 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
pipeline {
agent {
label "centos-latest"
}

options {
timeout(time: 60, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds(abortPrevious: true)
}

tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk17-latest'
}

environment {
BUILD_TIMESTAMP = sh(returnStdout: true, script: 'date +%Y%m%d%H%M').trim()
MAIN_BRANCH = 'master'
}

parameters {
choice(
name: 'BUILD_TYPE',
choices: ['nightly', 'milestone', 'release'],
description: '''
Choose the type of build.
Note that a release build will <b>not</b> promote the build, but rather will promote the most recent milestone build.
'''
)

booleanParam(
name: 'ECLIPSE_SIGN',
defaultValue: true,
description: '''
Choose whether or not the bundles will be signed.
This is relevant only for nightly and milestone builds.
'''
)

booleanParam(
name: 'PROMOTE',
defaultValue: true,
description: 'Whether to promote the build to the download server.'
)
}

stages {
stage('Display Parameters') {
steps {
script {
env.BUILD_TYPE = params.BUILD_TYPE
if (env.BRANCH_NAME == env.MAIN_BRANCH) {
// Only sign the master branch.
//
env.ECLIPSE_SIGN = params.ECLIPSE_SIGN
} else {
// Do not sign PR builds.
env.ECLIPSE_SIGN = false
}

// Only promote signed builds, i.e., do not sign or promote PR builds.
//
env.PROMOTE = params.PROMOTE && (env.ECLIPSE_SIGN == 'true')

def description = """
BUILD_TIMESTAMP=${env.BUILD_TIMESTAMP}
BUILD_TYPE=${env.BUILD_TYPE}
ECLIPSE_SIGN=${env.ECLIPSE_SIGN}
PROMOTE=${env.PROMOTE}
BRANCH_NAME=${env.BRANCH_NAME}
""".trim()
echo description
currentBuild.description = description.replace("\n", "<br/>")
}
}
}

stage('Build Nebula') {
steps {
script {
if (env.PROMOTE == 'true') {
// Only provide an agent context, which allows uploading to download.eclipse.org if we are promoting.
// PR builds are not permitted to promote.
//
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
mvn()
}
} else {
mvn()
archiveArtifacts 'releng/org.eclipse.nebula.site/target/repository/**'
}
}
}
}
}

post {
always {
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml'
recordIssues publishAllIssues: true, tools: [java(), mavenConsole(), javaDoc()]
}

failure {
archiveArtifacts '**'
mail to: '[email protected]',
subject: "[Nebula CI] Build Failure ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
}

fixed {
mail to: '[email protected]',
subject: "[Nebula CI] Back to normal ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
}

cleanup {
deleteDir()
}
}
}

def void mvn() {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
// Only promoted builds will be signed.
//
sh '''
if [[ $PROMOTE == true ]]; then
promotion_argument='-Ppromote -Pbuild-server'
fi
mvn \
$promotion_argument \
--no-transfer-progress \
-Dproject.build.sourceEncoding=UTF-8 \
-Dbuild.id=${BUILD_TIMESTAMP} \
-Dgit.commit=$GIT_COMMIT \
-Dbuild.type=$BUILD_TYPE \
-Dorg.eclipse.justj.p2.manager.build.url=$JOB_URL \
clean \
verify
'''
}
}
7 changes: 2 additions & 5 deletions examples/org.eclipse.nebula.examples.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.eclipse.nebula.examples.feature"
label="Nebula Examples View Feature"
label="Nebula Examples View"
version="1.0.4.qualifier"
provider-name="Eclipse Nebula">

Expand All @@ -19,9 +19,6 @@

<plugin
id="org.eclipse.nebula.examples"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
version="0.0.0"/>

</feature>
21 changes: 9 additions & 12 deletions examples/org.eclipse.nebula.examples.feature/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (C) 2012, 2013, 2017, RemainSoftware & Red Hat Inc.

Expand All @@ -12,24 +11,22 @@ Contributors:
* Wim Jongman (RemainSoftware)
* Mickael Istria (Red Hat Inc.)
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<parent>
<artifactId>nebula-parent</artifactId>
<groupId>org.eclipse.nebula</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/org.eclipse.nebula.nebula-parent</relativePath>
</parent>
</parent>

<artifactId>org.eclipse.nebula.examples.feature</artifactId>
<packaging>eclipse-feature</packaging>
<artifactId>org.eclipse.nebula.examples.feature</artifactId>
<packaging>eclipse-feature</packaging>
<version>1.0.4-SNAPSHOT</version>

<name>Nebula Examples View Feature</name>
<name>Nebula Examples View Feature</name>

<groupId>org.eclipse.nebula</groupId>
<version>1.0.4-SNAPSHOT</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
1 change: 0 additions & 1 deletion examples/org.eclipse.nebula.examples/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ Export-Package: org.eclipse.nebula.examples
Bundle-Activator: org.eclipse.nebula.examples.internal.Activator
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Automatic-Module-Name: org.eclipse.nebula.examples
1 change: 1 addition & 0 deletions examples/org.eclipse.nebula.examples/nebula.product
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<plugin id="org.eclipse.swt.carbon.macosx" fragment="true"/>
<plugin id="org.junit"/>
</plugins>
-->

<features>
<feature id="org.eclipse.rcp"/>
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.nebula.examples/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ category.name = Nebula
perspective.name = Nebula
product.name = Nebula Examples
extension-point.name = Nebula Example Part
Bundle-Name = Nebula Examples Plug-in
Bundle-Name = Nebula Examples
13 changes: 6 additions & 7 deletions examples/org.eclipse.nebula.examples/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (C) 2012, 2013, 2017, RemainSoftware & Red Hat Inc.

Expand All @@ -12,20 +11,20 @@ Contributors:
* Wim Jongman (RemainSoftware)
* Mickael Istria (Red Hat Inc.)
-->

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>

<parent>
<artifactId>nebula-parent</artifactId>
<groupId>org.eclipse.nebula</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/org.eclipse.nebula.nebula-parent</relativePath>
</parent>

<groupId>org.eclipse.nebula</groupId>

<artifactId>org.eclipse.nebula.examples</artifactId>
<version>1.0.4-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Loading
Loading