Skip to content

Commit

Permalink
update project config
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Dec 5, 2023
1 parent 994ecbb commit 515b45b
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 19 deletions.
4 changes: 1 addition & 3 deletions .ci/maven-settings.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">

<servers>
<server>
<id>github-commits</id>
<username>${env.GITHUB_USER}</username>
<password>${env.GITHUB_API_KEY}</password>
</server>
</servers>

</settings>
2 changes: 1 addition & 1 deletion .ci/maven-toolchains.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
<toolchain>
Expand Down
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ updates:
prefix-development: chore
include: scope
labels:
- pinned
- dependencies
- gha
- package-ecosystem: maven
Expand All @@ -25,5 +26,6 @@ updates:
prefix-development: chore
include: scope
labels:
- pinned
- dependencies
- mvn
76 changes: 65 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: © Sebastian Thomschke and contributors.
# SPDX-FileContributor: Sebastian Thomschke
# SPDX-License-Identifier: EPL-2.0
# SPDX-ArtifactOfProjectHomePage: https://github.com/sebthom/eclipse-commons
#
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Build

Expand Down Expand Up @@ -46,11 +51,20 @@ env:
KEYSTORE_PATH: /tmp/sebthom.github.io.p12
KEYSTORE_PW: whatever


jobs:

build:
###########################################################
maven-build:
###########################################################
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}


# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false


steps:
- name: Show environment variables
Expand All @@ -70,12 +84,18 @@ jobs:


- name: "Install: JDK ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v3 # https://github.com/actions/setup-java
uses: actions/setup-java@v4 # https://github.com/actions/setup-java
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}


- name: "Install: Maven"
uses: stCarolas/setup-maven@v4.5 # https://github.com/stCarolas/setup-maven
with:
maven-version: 3.9.6


- name: "Cache: Restore"
id: cache-restore
if: ${{ !env.ACT }} # https://github.com/nektos/act#skipping-steps
Expand All @@ -88,12 +108,6 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('build.target') }}-${{ hashFiles('**/pom.xml') }}


- name: "Install: Maven"
uses: stCarolas/setup-maven@v4.5 # https://github.com/stCarolas/setup-maven
with:
maven-version: 3.9.5


- name: Get Signing Certificate
if: ${{ github.ref_name == 'main' && !env.ACT }}
env:
Expand All @@ -111,7 +125,6 @@ jobs:
- name: Build with Maven
id: maven-build
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_API_KEY: ${{ github.token }}
Expand Down Expand Up @@ -165,7 +178,7 @@ jobs:
# https://cli.github.com/manual/gh_release_create
run: |
GH_DEBUG=1 gh release create "$RELEASE_NAME" \
--prerelease \
--title "latest" \
--latest \
--notes "${{ github.event.head_commit.message }}" \
--target "${{ github.sha }}" \
Expand Down Expand Up @@ -227,6 +240,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
# "|| true" is to avoid "Error: Resource not accessible by integration" from failing the job
gh actions-cache delete ${{ steps.cache-restore.outputs.cache-primary-key }} --confirm || true
- name: "Cache: Update"
Expand Down Expand Up @@ -259,8 +273,48 @@ jobs:
echo "start_ssh_session=true" | tee -a "$GITHUB_OUTPUT"
fi
- name: "SSH session for debugging: start"
uses: mxschmitt/action-tmate@v3 # https://github.com/mxschmitt/action-tmate
if: always() && steps.DEBUG_SSH_SESSSION_CHECK.outputs.start_ssh_session
with:
limit-access-to-actor: ${{ inputs.debug-with-ssh-only-for-actor }}


###########################################################
dependabot-pr-auto-merge:
###########################################################
needs: maven-build
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest

concurrency: dependabot-pr-auto-merge

permissions:
contents: write
pull-requests: write

steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1 # https://github.com/dependabot/fetch-metadata/
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"


- name: Enable auto-merge for Dependabot PRs
if: |
${{
(
steps.dependabot-metadata.outputs.package-ecosystem == 'github-actions' &&
steps.metadata.outputs.update-type == 'version-update:semver-major'
) || (
steps.dependabot-metadata.outputs.package-ecosystem == 'maven' &&
steps.metadata.outputs.update-type == 'version-update:semver-minor'
)
}}
run: |
gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!--
Copyright 2021-2022 by Sebastian Thomschke and contributors.
SPDX-FileCopyrightText: © Sebastian Thomschke and contributors.
SPDX-FileContributor: Sebastian Thomschke
SPDX-License-Identifier: EPL-2.0
@author Sebastian Thomschke
SPDX-ArtifactOfProjectHomePage: https://github.com/sebthom/eclipse-commons
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://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">
Expand Down Expand Up @@ -38,7 +38,7 @@

<properties>
<java.version>17</java.version>
<tycho.version>4.0.0</tycho.version>
<tycho.version>4.0.4</tycho.version>

<!-- to prevent dozen of warnings like:
[WARNING] System artifact: p2.eclipse-plugin:org.eclipse.mylyn.commons.notifications.ui:jar:1.17.2.v20200813-0821:system has no file attached
Expand Down

0 comments on commit 515b45b

Please sign in to comment.