Skip to content

Change branches to build #36

Change branches to build

Change branches to build #36

Workflow file for this run

on:
push:
branches: [ "sovity/**" ]
release:
types: [ published ]
pull_request:
branches: [ "sovity/**" ]
jobs:
build-gradle-project:
name: Build Gradle Project
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build
- uses: ./.github/actions/run-tests
- name: Debug
run: echo ${{ github.ref }}
- name: "Gradle: Publish"
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/sovity/') }}
run: |
if [[ "$GITHUB_REF" == "refs/tags/v"* ]]; then
GRADLE_ARGS="-Pversion=${GITHUB_REF#refs/tags/v}"
else if [[ "$GITHUB_REF" == "refs/heads/sovity/"* ]]; then
GRADLE_ARGS="-Pversion=${GITHUB_REF#refs/heads/sovity/}.0.$(date '+%Y%m%d.%H%M%S')"
else
GRADLE_ARGS="-Pversion=0.$(date '+%Y%m%d.%H%M%S')"
fi
echo "$GRADLE_ARGS"
#./gradlew "$GRADLE_ARGS" check publishAllPublicationsToGitHubPackagesRepository
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}