Skip to content

Commit

Permalink
build!: drop the Eclipse plugin and switch to Gradle (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK authored Nov 8, 2024
1 parent 3ceb317 commit 5d0b820
Show file tree
Hide file tree
Showing 121 changed files with 1,412 additions and 2,254 deletions.
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .github/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions .github/compute-java-range.rb

This file was deleted.

131 changes: 49 additions & 82 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,114 +4,81 @@ on:
workflow_dispatch:

jobs:
compute-java-range:
runs-on: ubuntu-24.04
outputs:
java-range: ${{ steps.range.outputs.java-range }}
min-java: ${{ steps.range.outputs.min-java }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Compute range
id: range
run: .github/compute-java-range.rb >> "$GITHUB_OUTPUT"
- name: Show result
run: echo "java-range=${{ steps.range.outputs.java-range }}"
# Runs all tests
build:
needs:
- compute-java-range
strategy:
fail-fast: false
matrix:
os: [ windows-2022, macos-14, ubuntu-24.04 ]
jvm_version: ${{ fromJson(needs.compute-java-range.outputs.java-range) }}
distribution: [ temurin ]
defaults:
run:
shell: bash
os: [ windows, macos, ubuntu ]
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 120
steps:
- name: Checkout
uses: DanySK/[email protected]
- uses: DanySK/[email protected]
with:
retries-on-failure: 3
build-command: >-
./gradlew build --parallel
check-command: true
deploy-command: >-
./gradlew uploadAllPublicationsToMavenCentralNexus close drop --parallel
should-run-codecov: ${{ runner.os == 'Linux' }}
should-deploy: >-
${{
runner.os == 'Linux'
&& !github.event.repository.fork
&& github.event_name != 'pull_request'
}}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
# Performs a release if needed
release:
permissions:
contents: write
needs:
- build
runs-on: ubuntu-latest
if: >-
!github.event.repository.fork
&& github.event_name != 'pull_request'
concurrency:
group: ${{ github.workflow }}-build-${{ toJson(matrix) }}-${{ github.event.number || github.ref }}
runs-on: ${{ matrix.os }}
env:
JAVA_VERSION: ${{ matrix.jvm_version }}
OS: ${{ matrix.os }}
TERM: dumb
group: release-${{ github.event.number || github.ref }}
cancel-in-progress: false
timeout-minutes: 120
steps:
- name: Checkout
uses: danysk/action-checkout@0.2.22
uses: actions/checkout@v4.2.2
with:
submodules: recursive
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Compute the version of Maven
id: maven
shell: bash
run: |
# Idea: the regex matcher of Renovate keeps this string up to date automatically
# The version is extracted and used to access the correct version of the scripts
USES=$(cat <<TRICK_RENOVATE
- uses: apache/[email protected]
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@v}\""
echo "{version}={${USES#*@v}}" >> $GITHUB_OUTPUT
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: ${{ steps.maven.outputs.version }}
- name: Find the version of Node from package.json
if: matrix.jvm_version == ${{ needs.compute-java-range.outputs.min-java }} && contains('Linux', runner.os)
id: node-version
run: echo "version=$(jq -r .engines.node package.json)" >> $GITHUB_OUTPUT
- name: Install Node
if: matrix.jvm_version == ${{ needs.compute-java-range.outputs.min-java }} && contains('Linux', runner.os)
uses: actions/[email protected]
with:
node-version: ${{ steps.node-version.outputs.version }}
- name: Checkout the update site
if: matrix.jvm_version == ${{ needs.compute-java-range.outputs.min-java }} && contains('Linux', runner.os)
uses: actions/[email protected]
with:
path: update-site
fetch-depth: 0
persist-credentials: true
repository: Protelis/update-site
token: ${{ secrets.DEPLOYMENT_TOKEN }}
node-version-file: package.json
- uses: DanySK/[email protected]
with:
retries-on-failure: 3
build-command: |
mvn package -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q
check-command: |
mvn test -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q
retries-on-failure: 1
build-command: true
check-command: true
deploy-command: |
echo '${{ secrets.SIGNING_KEY }}' > key.asc
gpg --import key.asc
rm key.asc
mvn deploy nexus-staging:drop -B -Dmaven.test.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q
npm install
npx semantic-release
java-distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jvm_version }}
should-run-codecov: false
should-deploy: >-
${{
matrix.jvm_version == 11
&& matrix.os == 'ubuntu'
&& !github.event.repository.fork
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
}}
should-validate-wrapper: false
should-deploy: true
github-token: ${{ secrets.DEPLOYMENT_TOKEN }}
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}

success:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs:
- build
- compute-java-range
- release
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/dispatcher.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: CI/CD
on:
push:
# Disables the branch builds for some branches,
# the dispatcher for PRs should get triggered anyway
branches-ignore:
# Dependabot branch builds disabled as they do not access secrets
- 'dependabot/**'
paths-ignore:
- '.gitignore'
Expand All @@ -17,24 +14,8 @@ on:
workflow_dispatch:

jobs:
inspect:
runs-on: ubuntu-latest
if: false
steps:
- run: |
echo 'github.event_name = ${{ github.event_name }}'
echo 'github.event.pull_request.head.repo.full_name = ${{ github.event.pull_request.head.repo.full_name }}'
echo 'github.repository = ${{ github.repository }}'
echo 'github.head_ref = ${{ github.head_ref }}'
dispatcher:
runs-on: ubuntu-latest
# This filter blocks all pull-request builds that also have a branch build.
# Called workflows inherit the event, so, internally the workflow can distinguish.
# If the event is not a pull request, then the build should run
# (it is either a branch push or a dispatched workflow).
# If the pull request comes from another repo, then the build should run.
# If the pull request is from a dependabot branch, it should run, as
# the dispatcher is disabled for dependabot branch builds.
if: >-
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.repository
Expand Down
24 changes: 7 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
*/bin/*
.metadata/*
.directory
*/target/*
*/src-gen/
*/xtend-gen/
**/generated/*
*.xml_gen
**/.recommenders/*
*_gen
/.metadata/
.gradle/
prepare_environment.sh
settings.xml
secrets.tar
.metadata/
.recommenders/
bin/
build/
generated/
*-gen/
target/
*/build/
*.iml
.idea/
*_gen
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/Protelis.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5d0b820

Please sign in to comment.