Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/KianRolf/IDEasy
Browse files Browse the repository at this point in the history
  • Loading branch information
KianRolf committed Nov 27, 2024
2 parents bb75cf9 + cfd61d5 commit 3668654
Show file tree
Hide file tree
Showing 25 changed files with 522 additions and 165 deletions.
45 changes: 6 additions & 39 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,13 @@ on:
workflow_dispatch

jobs:
# Builds documentation pdf file in cli/target/package and uploads artifact to docs
build-documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Make documentation available
run: |
cd documentation
mvn -B -ntp -Dstyle.color=always -DskipTests=true package
- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: documentation/target/generated-docs/*.pdf

# Downloads documentation docs artifact, builds all native images, archives native image for each os with documentation pdf file and uploads artifacts to f.e. natives-windows-latest
# Builds all native images and uploads each binary as a separate artifact
build-natives:
name: Build native images
needs: build-documentation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest, macos-13 ]

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -45,26 +20,21 @@ jobs:
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Download documentation
uses: actions/download-artifact@v4
with:
name: docs
path: ./cli/target/package
- name: Build native image
shell: bash
run: |
cd cli
mvn -B -ntp -Dideasy.assembly.id=${{ matrix.os }} -Pnative -DskipTests=true package
mvn -B -ntp -Pnative -DskipTests=true compile
- name: Upload native image
uses: actions/upload-artifact@v4
with:
name: natives-${{ matrix.os }}
path: cli/target/*.tar.gz
path: cli/target/ideasy*

# Downloads all native image artifacts to cli/target and builds the project for deployment to OSSRH Nexus
# Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to OSSRH Nexus
deploy:
name: Build Project and Deploy
needs: [ build-documentation, build-natives ]
needs: [ build-natives ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -80,11 +50,8 @@ jobs:
with:
pattern: natives-*
path: ./cli/target/
merge-multiple: true
- run: |
mvn -B -ntp -Dstyle.color=always install
- name: Deploy to OSSRH nexus
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dmaven.install.skip=true -Dgpg.skip=true -Dstyle.color=always -B -ntp -Pdeploy deploy
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dgpg.skip=true -Dstyle.color=always -B -ntp -Passembly,deploy deploy
46 changes: 9 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,13 @@ on:

jobs:

# Builds documentation pdf file in cli/target/package and uploads artifact to docs
build-documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Make documentation available
run: |
cd documentation
mvn -B -ntp -Dstyle.color=always -DskipTests=true package
- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: documentation/target/generated-docs/*.pdf

# Downloads documentation docs artifact, builds all native images, archives native image for each os with documentation pdf file and uploads artifacts to f.e. natives-windows-latest
# Adjusts the revision to the latest version, builds images for each OS type/architecture using matrix:os and uploads each binary as a separate artifact
build-natives:
name: Build native images
needs: build-documentation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest, macos-13 ]

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -48,11 +23,6 @@ jobs:
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Download documentation
uses: actions/download-artifact@v4
with:
name: docs
path: ./cli/target/package
- name: Build native image
shell: bash
run: |
Expand All @@ -61,17 +31,20 @@ jobs:
current_version="${current_version/ */}"
next_version="${current_version/-SNAPSHOT/}"
cd cli
mvn -B -ntp -Drevision=${next_version} -Dideasy.assembly.id=${{ matrix.os }} -Pnative -DskipTests=true package
mvn -B -ntp -Drevision=${next_version} -Pnative -DskipTests=true compile
- name: Upload native image
uses: actions/upload-artifact@v4
with:
name: natives-${{ matrix.os }}
path: cli/target/*.tar.gz
path: cli/target/ideasy*

# Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to Maven Central.
# The version number for the next build will be incremented automatically.
# A GitHub release and download URLs pointing to the respective OS/architecture archives on Maven Central will be created.
release:
name: Release on Sonatype OSS
runs-on: ubuntu-latest
needs: [ build-documentation, build-natives ]
needs: build-natives
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -91,8 +64,7 @@ jobs:
with:
pattern: natives-*
path: ./cli/target/
merge-multiple: true
- name: Publish to Apache Maven Central
- name: Create assemblies and publish to Apache Maven Central
run: |
maven_config="$(cat .mvn/maven.config)"
current_version="${maven_config/#*-Drevision=}"
Expand All @@ -106,7 +78,7 @@ jobs:
git tag -a "release/${next_version}" -m "tagged version ${next_version}"
export GPG_TTY=$TTY
mkdir -p ./cli/target/
mvn --settings .mvn/settings.xml -B -ntp deploy -Pdeploy -Dgpg.pin.entry.mode=loopback -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
mvn --settings .mvn/settings.xml -B -ntp deploy -Passembly,deploy -Dgpg.pin.entry.mode=loopback -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Release with new features and bugfixes:
* https://github.com/devonfw/IDEasy/issues/589[#589]: Fix NLS Bundles for Linux and MacOS
* https://github.com/devonfw/IDEasy/issues/637[#637]: Added option to disable updates
* https://github.com/devonfw/IDEasy/issues/764[#764]: IDEasy not working properly in CMD
* https://github.com/devonfw/IDEasy/issues/81[#81]: Implement Toolcommandlet for Kubernetes
* https://github.com/devonfw/IDEasy/issues/758[#758]: Create status commandlet
* https://github.com/devonfw/IDEasy/issues/754[#754]: Again messages break processable command output

The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/16?closed=1[milestone 2024.12.001].
Expand Down
98 changes: 28 additions & 70 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,33 @@

<profiles>
<!-- Builds the native image and archives it with the documentation from the github artifact -->
<profile>
<id>assembly</id>
<build>
<plugins>
<!-- Assembly Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${assembly.maven.plugin.version}</version>
<executions>
<execution>
<id>create-distribution</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${revision}</finalName>
<appendAssemblyId>true</appendAssemblyId>
<descriptorSourceDirectory>src/main/assembly</descriptorSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<build>
Expand All @@ -189,7 +216,7 @@
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
<phase>compile</phase>
</execution>
<execution>
<id>test-native</id>
Expand All @@ -213,75 +240,6 @@
</buildArgs>
</configuration>
</plugin>
<!-- Assembly Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${assembly.maven.plugin.version}</version>
<executions>
<execution>
<id>create-distribution</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${revision}</finalName>
<appendAssemblyId>true</appendAssemblyId>
<descriptors>
<descriptor>/src/main/assembly/release-${ideasy.assembly.id}.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Attaches artifacts stored in cli/target/*.tgz to the maven build, moves them to documentation/target/nexus-staging/.../*.tgz and deploys them with the name defined in the classifier -->
<profile>
<id>deploy</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${project.artifactId}-${revision}-windows-x64.tar.gz</file>
<type>tar.gz</type>
<classifier>windows-x64</classifier>
</artifact>
<artifact>
<file>${project.build.directory}/${project.artifactId}-${revision}-linux-x64.tar.gz</file>
<type>tar.gz</type>
<classifier>linux-x64</classifier>
</artifact>
<artifact>
<file>${project.build.directory}/${project.artifactId}-${revision}-mac-x64.tar.gz</file>
<type>tar.gz</type>
<classifier>mac-x64</classifier>
</artifact>
<artifact>
<file>${project.build.directory}/${project.artifactId}-${revision}-mac-arm.tar.gz</file>
<type>tar.gz</type>
<classifier>mac-arm</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${settings.localRepository}/com/devonfw/tools/IDEasy/ide-doc/${project.version}/ide-doc-${project.version}.pdf</source>
<destName>IDEasy.pdf</destName>
</file>
</files>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<directory>${project.build.directory}/natives-ubuntu-latest</directory>
<outputDirectory>./bin</outputDirectory>
<includes>
<include>${imageName}</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${settings.localRepository}/com/devonfw/tools/IDEasy/ide-doc/${project.version}/ide-doc-${project.version}.pdf</source>
<destName>IDEasy.pdf</destName>
</file>
</files>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<directory>${project.build.directory}/natives-macos-latest</directory>
<outputDirectory>./bin</outputDirectory>
<includes>
<include>${imageName}</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${settings.localRepository}/com/devonfw/tools/IDEasy/ide-doc/${project.version}/ide-doc-${project.version}.pdf</source>
<destName>IDEasy.pdf</destName>
</file>
</files>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<directory>${project.build.directory}/natives-macos-13</directory>
<outputDirectory>./bin</outputDirectory>
<includes>
<include>${imageName}</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${settings.localRepository}/com/devonfw/tools/IDEasy/ide-doc/${project.version}/ide-doc-${project.version}.pdf</source>
<destName>IDEasy.pdf</destName>
</file>
</files>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<directory>${project.build.directory}/natives-windows-latest</directory>
<outputDirectory>./bin</outputDirectory>
<includes>
<include>${imageName}.exe</include>
Expand Down
Loading

0 comments on commit 3668654

Please sign in to comment.