Skip to content

Commit

Permalink
Merge pull request #89 from DataONEorg/develop
Browse files Browse the repository at this point in the history
Merge develop to main for the 3.0.0 release
  • Loading branch information
taojing2002 authored Apr 25, 2024
2 parents 71a5c14 + 939360d commit 1ad4183
Show file tree
Hide file tree
Showing 462 changed files with 190,906 additions and 33,794 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these users will be requested for
# review when someone opens a pull request.
* @mbjones @datadavev @taojing2002
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"
94 changes: 94 additions & 0 deletions .github/workflows/build-test-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Java Maven Build, Test, and Publish

on:
push:
branches:
- feature*
- develop
- '*-image-auto-publish'
tags: [ 'v*.*.*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
#IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: ${{ github.repository_owner }}/dataone-index-worker

jobs:
maven-build:
name: Maven Build and Test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Extract Maven project version
run: echo "version="$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) >> $GITHUB_OUTPUT
id: get_version
#- name: Show extracted Maven project version
#run: echo "Version from pom: " ${{ steps.get_version.outputs.version }}

- name: Build and Test
run: mvn --batch-mode --update-snapshots test
- name: Package
run: mvn --batch-mode --update-snapshots -DskipTests=true package
- uses: actions/cache@v3
with:
path: .
key: builddir-${{ github.run_id }}

docker-publish:
name: Docker Build and Publish
if: github.ref_name == 'develop' || github.ref_name == 'v*.*.*'
needs: maven-build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/cache@v3
with:
path: .
key: builddir-${{ github.run_id }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
build-args: TAG=${{needs.maven-build.outputs.version}}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
workflow_dispatch:
push:
branches:
- develop*
- main
#- develop

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.idea
target
.java-version
tlog/
charts/
Loading

0 comments on commit 1ad4183

Please sign in to comment.