-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (48 loc) · 1.78 KB
/
gradle_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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This workflow publishes a new version to the Github Registry.
#
# @author Armin Schnabel
# @version 1.0.2
# @since 5.0.0
name: Gradle Publish
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Create empty truststore file
run: |
# When no truststore is required by the server we create an empty file or else the build fails
mkdir -p synchronization/src/main/res/raw
touch synchronization/src/main/res/raw/truststore.jks
- name: Add gradle.properties
run: |
# Use the repository's automatically set up token to pushlish to the registry
cp gradle.properties.template gradle.properties
echo "githubUser=${{ github.actor }}" >> gradle.properties
echo "githubToken=${{ secrets.GITHUB_TOKEN }}" >> gradle.properties
# versionName is required to publish artifacts to Github Registry
- name: Set versionName
run: |
sed -i "s/cyfaceBackendVersion = \"0.0.0\"/cyfaceBackendVersion = \"${{ github.ref_name }}\"/g" build.gradle
- name: Publish with Gradle
run: ./gradlew publishAll
# Automatically mark this tag as release on Github
- uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
# Release tags of format `1.2.3-beta1 / -alpha1 / -test1` are considered a pre-release
prerelease: ${{ contains(github.ref, 'test') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}