Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Github Actions plus cleanup and updates to POM files #975

Merged
merged 82 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
cf1bd85
Working version of POM with updated plugin versions
JeremyMcCormick Apr 4, 2023
5dc127e
Add Github actions
JeremyMcCormick Apr 4, 2023
bdea10b
Ignore local Maven repo
JeremyMcCormick Apr 4, 2023
5f43ff4
POM cleanup
JeremyMcCormick Apr 4, 2023
65efeca
Add Maven settings with CI deployment credentials
JeremyMcCormick Apr 4, 2023
2409cdd
Add Github site information to POM
JeremyMcCormick Apr 4, 2023
53be78b
Merge pull request #1 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
8936b5f
Correct maven-release-plugin version and additional cleanup
JeremyMcCormick Apr 4, 2023
ace6174
Merge pull request #2 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
17d7a98
Correct maven args command
JeremyMcCormick Apr 4, 2023
cd325bf
Merge pull request #3 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
4b45268
[hps-release skip] prepare release hps-java-0.0.1
JeremyMcCormick Apr 4, 2023
78f54f9
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 4, 2023
b962600
[hps-release skip] prepare release hps-java-0.0.1
JeremyMcCormick Apr 4, 2023
230efd2
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 4, 2023
5e00749
Disable shade plugin from making dependency reduced pom
JeremyMcCormick Apr 4, 2023
2489c9b
Correct path to bin jar in workflow
JeremyMcCormick Apr 4, 2023
c4f4418
Merge pull request #4 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
f8c60ae
Skip deployment of all modules except distribution
JeremyMcCormick Apr 4, 2023
b9d6228
Add back profile for activating default cache dir
JeremyMcCormick Apr 4, 2023
87fc1be
Correct formatting
JeremyMcCormick Apr 4, 2023
24c7b12
Minor formatting changes
JeremyMcCormick Apr 4, 2023
097f93c
Merge pull request #5 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
283eacd
[hps-release skip] prepare release hps-java-0.0.1
JeremyMcCormick Apr 4, 2023
e88a477
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 4, 2023
9886a13
Put online-recon deps in top pom and exclude jdom 1.0 from being used…
JeremyMcCormick Apr 4, 2023
ca25647
Add write-all permissions to release workflow
JeremyMcCormick Apr 4, 2023
96a8bc6
[hps-release skip] prepare release hps-java-0.0.1
JeremyMcCormick Apr 4, 2023
c7a1ba2
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 4, 2023
a8099d5
Merge pull request #6 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
056a2d5
[hps-release skip] prepare release hps-java-0.0.1
JeremyMcCormick Apr 4, 2023
812b2c3
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 4, 2023
356496b
Move versioning of additional dependencies to top pom
JeremyMcCormick Apr 4, 2023
4cd3c97
Add permissions for site workflow
JeremyMcCormick Apr 4, 2023
cd2a032
Correct reporting config for current plugin version
JeremyMcCormick Apr 4, 2023
0b9a451
Merge pull request #7 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 4, 2023
a85d61a
Hack to remove module links from sidebar
JeremyMcCormick Apr 5, 2023
6c4e8ee
More pom changes for site build
JeremyMcCormick Apr 5, 2023
aae4dfb
Delete unused module dirs from staging before deploying site
JeremyMcCormick Apr 5, 2023
121ebfb
Correct staging dir
JeremyMcCormick Apr 5, 2023
6182b35
More cleanup of pom for site
JeremyMcCormick Apr 5, 2023
129d1e1
Merge pull request #8 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 5, 2023
26df845
Minor cleanup to pom files
JeremyMcCormick Apr 5, 2023
c5a85a1
Fix up custom site (Maven seems to ignore this file though)
JeremyMcCormick Apr 5, 2023
b701662
Remove shell script
JeremyMcCormick Apr 5, 2023
e156858
Ignore user VS Code settings file
JeremyMcCormick Apr 5, 2023
54f920e
Remove comment
JeremyMcCormick Apr 5, 2023
51d37c7
Merge branch 'master' into feature/issue-959/implement-github-actions
JeremyMcCormick Apr 5, 2023
51ee99d
Merge pull request #9 from JeremyMcCormick/feature/issue-959/implemen…
JeremyMcCormick Apr 5, 2023
ed88d9b
[hps-release skip] prepare release hps-java-0.0.2
JeremyMcCormick Apr 5, 2023
753d275
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 5, 2023
c48d026
Build the project to get jars into local Maven cache
JeremyMcCormick Apr 5, 2023
a562b4d
Merge pull request #10 from JeremyMcCormick/feature/issue-959/impleme…
JeremyMcCormick Apr 5, 2023
e3bd2ea
[hps-release skip] prepare release hps-java-0.0.3
JeremyMcCormick Apr 5, 2023
e8692a4
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 5, 2023
d7d8fb7
Rearrange site directory
JeremyMcCormick Apr 5, 2023
80a451c
Add organization link to pom
JeremyMcCormick Apr 5, 2023
9a9159c
Add boilerplate log4j prop file to get rid of warnings when tests run
JeremyMcCormick Apr 6, 2023
c6bd332
Use standard site build now that module issue was solved
JeremyMcCormick Apr 6, 2023
b4a8187
Configure pom so site build works correctly
JeremyMcCormick Apr 6, 2023
621ae66
Update the project site
JeremyMcCormick Apr 6, 2023
7b5ff79
Remove report from site
JeremyMcCormick Apr 6, 2023
1c00fe0
Remove surefire report from website for now
JeremyMcCormick Apr 9, 2023
b01bb21
Remove surefire report from website for now
JeremyMcCormick Apr 9, 2023
8d831f2
Merge pull request #11 from JeremyMcCormick/feature/issue-959/impleme…
JeremyMcCormick Apr 9, 2023
983859f
[hps-release skip] prepare release hps-java-0.0.4
JeremyMcCormick Apr 9, 2023
ce2ada1
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 9, 2023
ad18c79
[hps-release skip] prepare release hps-java-0.0.2
JeremyMcCormick Apr 10, 2023
c1d2c91
Revert "[hps-release skip] prepare release hps-java-0.0.2"
JeremyMcCormick Apr 10, 2023
49ad5dc
[hps-release skip] prepare release hps-java-0.0.6
JeremyMcCormick Apr 10, 2023
e5a7765
[hps-release skip] prepare for next development iteration
JeremyMcCormick Apr 10, 2023
3cd321a
Change fork repo to JLab
JeremyMcCormick Apr 10, 2023
27fc56d
Merge pull request #12 from JeremyMcCormick/feature/issue-959/impleme…
JeremyMcCormick Apr 10, 2023
c2d2789
Fix website href
JeremyMcCormick Apr 11, 2023
d04970e
Update version
JeremyMcCormick Sep 7, 2023
e6fb954
Change to old repo for release
JeremyMcCormick Sep 7, 2023
6b8d621
Undo version change
JeremyMcCormick Sep 7, 2023
b93da87
Use old dev connection
JeremyMcCormick Sep 7, 2023
9a73a4f
[hps-release skip] prepare release hps-java-0.0.9720232
JeremyMcCormick Sep 7, 2023
8e9e367
[hps-release skip] prepare for next development iteration
JeremyMcCormick Sep 7, 2023
7c53d37
Put jlab refs back
JeremyMcCormick Sep 7, 2023
5a29086
Merge branch 'master' of https://github.com/jeremymccormick/hps-java
JeremyMcCormick Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: deploy
on:
workflow_dispatch:
push:
branches:
- master
# Ignore release tags
tags-ignore:
- hps-java-*
tomeichlersmith marked this conversation as resolved.
Show resolved Hide resolved

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Deploy Snapshots with Maven
run: mvn -B deploy -s .maven_settings.xml -DretryFailedDeploymentCount=10
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
25 changes: 0 additions & 25 deletions .github/workflows/maven.yml

This file was deleted.

166 changes: 166 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: release

permissions: write-all

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to use for release"
required: true
default: "master"
release_version:
description: "Release version"
required: true
default: "auto"
development_version:
description: "New development version"
required: true
default: "auto"
dry_run:
description: "Perform a dry run for testing"
required: false
type: boolean
default: false
skip_tests:
description: "Skip running the tests"
required: false
type: boolean
default: false
skip_javadoc:
description: "Skip javadoc generation"
required: false
type: boolean
default: true
quiet:
description: "Quiet output - only show errors"
required: false
type: boolean
default: false
generate_release_notes:
description: "Generate release notes"
required: false
type: boolean
default: true
deploy_site:
description: "Update the project website"
required: false
type: boolean
default: true
secrets:
SSH_PRIVATE_KEY:
required: true
CI_DEPLOY_USERNAME:
required: true
CI_DEPLOY_PASSWORD:
required: true

jobs:
# TODO: Add test here for a sanity check
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still an active todo?

release:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.maven_release_step.outputs.release_tag }}
steps:
- name: Check release version
if: inputs.release_version != 'auto' && inputs.development_version == 'auto'
run: |
echo "ERROR: Release version was provided but next development version was set to auto."
exit 1

- name: Checkout source code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Create Maven args file
run: |
touch .maven_args
echo "MAVEN_ARGS_FILE=.maven_args" >> $GITHUB_ENV

- name: Set input release version
if: inputs.release_version != 'auto'
run: |
echo -n "-DreleaseVersion=${{ inputs.release_version }}" >> ${{ env.MAVEN_ARGS_FILE }}
echo "MAVEN_RELEASE_VERSION=${{ inputs.release_version }}" >> $GITHUB_ENV

- name: Set default input release version
if: inputs.release_version == 'auto'
run: echo "MAVEN_RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed s/-SNAPSHOT//g)" >> $GITHUB_ENV

- name: Set input development version
if: inputs.development_version != 'auto'
run: |
if [[ "${{ inputs.development_version}}" != *-SNAPSHOT ]]
then
echo "ERROR: Development version must end with -SNAPSHOT."
exit 1
fi
echo -n " -DdevelopmentVersion=${{ inputs.development_version }}" >> ${{ env.MAVEN_ARGS_FILE }}
shell: bash

- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Get email
id: get_email
uses: evvanErb/get-github-email-by-username-action@v1.25
with:
github-username: ${{ github.actor }}

- name: Configure Git user
run: |
git config user.email "${{ steps.get_email.outputs.email }}"
git config user.name "${{ github.actor }}"
echo "Username: ${{ github.actor }}"
echo "Email: ${{ steps.get_email.outputs.email }}"

- name: Set Maven quiet
if: inputs.quiet
run: echo -n " -q" >> ${{ env.MAVEN_ARGS_FILE }}

- name: Set Maven arguments variable
run: |
echo "Extra Maven args: $(cat ${{ env.MAVEN_ARGS_FILE }})"
echo "MAVEN_ARGS=$(cat ${{ env.MAVEN_ARGS_FILE }})" >> $GITHUB_ENV

- name: Perform Maven release
id: maven_release_step
run: |
mvn release:prepare release:perform \
-DdryRun=${{ inputs.dry_run }} \
-DskipTests=${{ inputs.skip_tests }} \
-Darguments="-DskipTests=${{ inputs.skip_tests }} -Dmaven.javadoc.skip=${{ inputs.skip_javadoc }} \
-Dmaven.site.skip=true -Dmaven.site.deploy.skip=true -DgenerateReports=false" \
-B -e -s .maven_settings.xml \
${{ env.MAVEN_ARGS }}
echo "release_tag=${{ github.event.repository.name }}-${{ env.MAVEN_RELEASE_VERSION }}" >> $GITHUB_OUTPUT
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

- name: Make Github release
id: github_release
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.repository.name }}-${{ env.MAVEN_RELEASE_VERSION }}
name: ${{ github.event.repository.name }} ${{ env.MAVEN_RELEASE_VERSION }}
generate_release_notes: ${{ inputs.generate_release_notes }}
draft: false
prerelease: false
files: |
./distribution/target/hps-distribution-${{ env.MAVEN_RELEASE_VERSION }}-bin.jar
site:
needs: release
if: ${{ !inputs.dry_run && inputs.deploy_site }}
uses: JeffersonLab/hps-java/.github/workflows/site.yml@master
with:
tag: ${{ needs.release.outputs.release_tag }}
secrets: inherit
63 changes: 63 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: site

permissions:
deployments: write
pages: write

on:
workflow_call:
inputs:
tag:
description: "Tag to use for site deployment"
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: "Tag to use for site deployment"
required: true
type: string

jobs:
deploy-site:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}

- name: Validate tag
run: |
if [ "$(git name-rev --name-only --tags HEAD)" == "undefined" ]; then
echo "ERROR: Reference used as input is not a valid tag."
exit 1
fi

- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Get email
id: get_email
uses: evvanErb/get-github-email-by-username-action@v1.25
with:
github-username: ${{ github.actor }}

- name: Configure Git user
run: |
git config --global user.email "${{ steps.get_email.outputs.email }}"
git config --global user.name "${{ github.actor }}"
echo "Username: ${{ github.actor }}"
echo "Email: ${{ steps.get_email.outputs.email }}"

- name: Build project and run tests
run: mvn clean install verify

- name: Build and deploy the site
run: mvn site site:stage scm-publish:publish-scm -q
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test

on:
workflow_dispatch:
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Build and run tests
run: |
mvn -B install -T4
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ target/

# editor swap files
.*.swp

# local Maven repository
.m2repo

# ignore user VS Code settings
.vscode
17 changes: 17 additions & 0 deletions .maven_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>lcsim-repo-releases</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>lcsim-repo-snapshots</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
</settings>
9 changes: 7 additions & 2 deletions analysis/pom.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>hps-analysis</artifactId>
<name>analysis</name>
<description>common analysis code</description>

<parent>
<groupId>org.hps</groupId>
<artifactId>hps-java</artifactId>
<relativePath>../pom.xml</relativePath>
<version>5.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.hps</groupId>
<artifactId>hps-recon</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -29,4 +33,5 @@
</plugin>
</plugins>
</build>
</project>

</project>
Loading