forked from eclipse-edc/Connector
-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (33 loc) · 1.1 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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')"
fi
./gradlew "$GRADLE_ARGS" check publishAllPublicationsToGitHubPackagesRepository
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}