chore: update dependencies #88
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# We run CI on PRs targetting main, and pushes to the main branch. We also run | |
# on release created events, using the tag name as the version. | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
jobs: | |
ci: | |
name: Package, Test, and Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'adopt' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
cache: maven | |
- name: Set POM version | |
# Set the version in the POM to the short commit hash and append | |
# -SNAPSHOT to the version. This allows us to test the release process | |
# on branches without having to push a tag. If we are triggered by a | |
# release event, we set the version to the release version as the tag. | |
run: | | |
if [[ $GITHUB_EVENT_NAME == release ]]; then | |
mvn versions:set -DnewVersion=${GITHUB_REF#refs/tags/} --file posthog/pom.xml | |
else | |
mvn versions:set -DnewVersion=$(git rev-parse --short HEAD)-SNAPSHOT --file posthog/pom.xml | |
fi | |
- name: Build with Maven | |
run: mvn package --file posthog/pom.xml -DskipTests --batch-mode --show-version | |
- name: Run tests | |
run: mvn test --file posthog/pom.xml --batch-mode --show-version | |
- name: Release to Maven Central | |
# Deploy the Java jar artifact to Maven Central using mvn deploy. If we | |
# are triggered by a release event, we use the release profile, and we | |
# set the version the release version as the tag name. Otherwise, we | |
# set the version to the commit hash and append -SNAPSHOT to the | |
# version. | |
# | |
# This allows us to test the release process on branches without having | |
# to push a release. | |
run: | | |
if [[ $GITHUB_EVENT_NAME == release ]]; then | |
mvn deploy --file posthog/pom.xml --batch-mode --show-version -P release | |
else | |
mvn deploy --file posthog/pom.xml --batch-mode --show-version | |
fi | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |