Skip to content

Commit

Permalink
Added GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrichner-oviva committed May 16, 2024
1 parent 2fc2de5 commit c0ffeed
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Publish package to GitHub Packages
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Get version
id: version
run: |
echo "parsing version from ref '$GITHUB_REF'"
VERSION=$(echo "$GITHUB_REF" | sed -e "s|refs/tags/||g" | sed -E 's/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4/g')
echo "version: '$VERSION'"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Update Version
run: |
echo "updating version to '$VERSION'"
mvn -B versions:set "-DnewVersion=$VERSION"
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: write
24 changes: 24 additions & 0 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: run unit tests

on:
push:
branches:
- 'main'
pull_request:
paths-ignore:
- '.github/**'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Run unit tests
run: |
mvn test

0 comments on commit c0ffeed

Please sign in to comment.