diff --git a/.github/workflows/jfrog-publish.yml b/.github/workflows/jfrog-publish.yml deleted file mode 100644 index 8b3344ddd26..00000000000 --- a/.github/workflows/jfrog-publish.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This workflow will build a package using Maven and then publish it to repo.heigit.org when a release is created - -name: Publish on repo.heigit.org - -on: - workflow_dispatch: - release: - types: [created] - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Set version - run: mvn versions:set -DnewVersion=${{ github.ref_name }} - - - name: Build with Maven - run: mvn -B install -Dmaven.test.skip=true -f pom.xml - - - name: Prepare generated files - run: 'mkdir -p dist/com/github/GIScience/graphhopper && - cp -R ~/.m2/repository/com/github/GIScience/graphhopper/* ./dist/com/github/GIScience/graphhopper && - find dist -type f -name "*.xml" -delete && find dist -type f -name "*.repositories" -delete' - - - name: List files - run: pwd && ls -laR dist/* - - - name: Publish to repository - uses: advancedcsg-open/action-jfrog-cli@master - with: - url: 'https://repo.heigit.org/' - credentials type: 'accesstoken' - access token: ${{ secrets.ARTIFACTORY_ACCESSTOKEN }} - args: u "dist/" "libs-release-local/" --recursive=true diff --git a/.github/workflows/push-packages.yml b/.github/workflows/push-packages.yml new file mode 100644 index 00000000000..e493dd607aa --- /dev/null +++ b/.github/workflows/push-packages.yml @@ -0,0 +1,54 @@ +name: Publish to GitHub Packages +on: + push: + branches: + - 'releases/v0.13.24' + release: + types: [ published ] +jobs: + publish: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + - name: Cache Maven artifacts + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Cache node + uses: actions/cache@v2 + with: + path: web-bundle/node + key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os}}-node- + - name: Cache node_modules + uses: actions/cache@v2 + 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 on snapshot + if: github.event_name == 'push' && github.event_name != 'release' + run: | + mvn -B -DskipTests -Pskip-shaded-web-jar -Pskip-tools-jar source:jar deploy + env: + RT_USERNAME: ${{ secrets.RT_USERNAME }} + RT_PASSWORD: ${{ secrets.RT_PASSWORD }} + # Write a task to publish the package to GitHub Packages when a release is published + - name: Build and publish package on release + if: github.event_name == 'release' + run: | + mvn versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false + mvn -B -DskipTests -Pskip-shaded-web-jar -Pskip-tools-jar source:jar deploy + env: + RT_USERNAME: ${{ secrets.RT_USERNAME }} + RT_PASSWORD: ${{ secrets.RT_PASSWORD }} diff --git a/.github/workflows/run_maven_tests.yml b/.github/workflows/run_maven_tests.yml new file mode 100644 index 00000000000..6bf6941f68b --- /dev/null +++ b/.github/workflows/run_maven_tests.yml @@ -0,0 +1,34 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: + - 'releases/v0.13.24' + pull_request: + branches: + - 'releases/v0.13.24' + +jobs: + run_tests: + name: Run unit and integration tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Test, build, run API tests + run: # mvn -B -f pom.xml verify