Skip to content

Commit

Permalink
Revert "try adding CI"
Browse files Browse the repository at this point in the history
This reverts commit b48521f.
  • Loading branch information
mark-idleman committed Oct 20, 2023
1 parent 8ff396a commit 9f605a0
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 106 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Please read [our contributing guide](https://github.com/graphhopper/graphhopper/blob/master/CONTRIBUTING.md) and note that also your contribution falls under the Apache License 2.0 as outlined there.

Your first contribution should include a change where you add yourself to the CONTRIBUTORS.md file.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Test
on: push
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
java-version: [ 20, 21-ea ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: temurin
- name: Cache Maven artifacts
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache node
uses: actions/cache@v3
with:
path: web-bundle/node
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os}}-node-
- name: Cache node_modules
uses: actions/cache@v3
with:
path: web-bundle/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml', '**/package.json') }}
restore-keys: |
${{ runner.os}}-node_modules-
- name: Build ${{ matrix.java-version }}
run: mvn -B clean test

106 changes: 0 additions & 106 deletions .github/workflows/build_test_push.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to GitHub Packages

# ignore tags as the untagged commit has the same GITHUB_SHA and would conflict
on:
push:
branches:
- '**'

jobs:
publish:
if: github.repository_owner == 'graphhopper'
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Cache Maven artifacts
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache node
uses: actions/cache@v3
with:
path: web-bundle/node
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os}}-node-
- name: Cache node_modules
uses: actions/cache@v3
with:
path: web-bundle/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml', '**/package.json') }}
restore-keys: |
${{ runner.os}}-node_modules-
- name: Build and publish package ${{ matrix.java-version }}
# special 'wagon' option due to https://github.com/orgs/community/discussions/49001
run: |
mvn -B versions:set -DnewVersion=$GITHUB_SHA -DgenerateBackupPoms=false
mvn -Dmaven.resolver.transport=wagon -B -DskipTests -Pskip-shaded-web-jar -Pskip-tools-jar source:jar deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/publish-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish to Maven Central

on:
push:
tags:
- '**'

jobs:
maven-central-publish:
if: github.repository_owner == 'graphhopper'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
# feed directly as multi line value
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Cache Maven artifacts
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache node
uses: actions/cache@v3
with:
path: web-bundle/node
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os}}-node-
- name: Cache node_modules
uses: actions/cache@v3
with:
path: web-bundle/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml', '**/package.json') }}
restore-keys: |
${{ runner.os}}-node_modules-
- name: clean install
run: |
mvn -Dkey=$API_KEY clean install -B
- name: Build and publish package to maven central ${{ matrix.java-version }}
run: |
echo "release to maven central"
mvn -B versions:set -DnewVersion=$GITHUB_REF_NAME -DgenerateBackupPoms=false
mvn deploy -P release -DskipTests=true -Dpgp.secretkey=keyring:id=0E2FBADB -B
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
19 changes: 19 additions & 0 deletions .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Remove old artifacts
on:
schedule:
- cron: '0 3 1 * *' # Every 1st of the month at 3am
workflow_dispatch:
jobs:
remove-old-artifacts:
if: github.repository_owner == 'graphhopper'
name: Remove old artifacts
runs-on: ubuntu-latest
timeout-minutes: 10 # stop the task if it takes longer

steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '11 months'
skip-tags: true
skip-recent: 10
14 changes: 14 additions & 0 deletions .github/workflows/trigger-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Trigger Benchmarks
on: push
jobs:
trigger_measurement:
if: github.repository_owner == 'graphhopper'
runs-on: ubuntu-22.04
environment: benchmarks
steps:
- name: trigger
run: |
curl -X POST -H "Authorization: token ${{ secrets.BENCHMARKS_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ secrets.BENCHMARKS_REPO }}/dispatches" \
-d '{"event_type":"measurement_core","client_payload":{"core_commit": "'$GITHUB_SHA'", "core_branch": "${{ github.ref_name }}" }}'

0 comments on commit 9f605a0

Please sign in to comment.