This repository was archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
73 lines (63 loc) · 2.48 KB
/
gradle.yml
File metadata and controls
73 lines (63 loc) · 2.48 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Java CI with Gradle for building, releasing and publishing
on:
push:
branches: [master]
workflow_dispatch:
jobs:
versions:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
tags: ${{ steps.tags.outputs.tags }}
steps:
- name: get current version
id: version
run: echo ::set-output name=version::$(curl -s https://raw.githubusercontent.com/oneuiproject/OneUI-Design-Library/master/gradle.properties | grep -Po '(?<=VERSION_NAME=).*')
- name: get previous version tags
id: tags
run: 'echo ::set-output name=tags::$(curl -s https://api.github.com/repos/oneuiproject/oneui-design-library/tags | grep -Po ''(?<="name": ").*(?=")'')'
publish:
name: build and publish
needs: versions
runs-on: ubuntu-latest
if: ${{ !contains(needs.versions.outputs.tags, needs.versions.outputs.version) }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: java setup and gradle caching
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: grant execute permission for gradlew
run: chmod +x gradlew
- name: decode key
run: |
echo "${{secrets.SIGNING_KEYFILE_BASE64}}" > ~/key.gpg.b64
base64 -d ~/key.gpg.b64 > ~/key.gpg
echo "SIGNING_KEYFILE=$(echo ~/key.gpg)" >> $GITHUB_ENV
- name: assemble release
run: ./gradlew -p ./yanndroid/oneui assembleRelease
- name: publish to maven central
run: ./gradlew publishToSonatype closeSonatypeStagingRepository
env:
SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
release:
needs: versions
runs-on: ubuntu-latest
if: ${{ !contains(needs.versions.outputs.tags, needs.versions.outputs.version) }}
steps:
- name: create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_name: ${{ needs.versions.outputs.version }}
tag_name: ${{ needs.versions.outputs.version }}
body: |
${{ github.event.head_commit.message }}
The latest release can be found [here](https://mvnrepository.com/artifact/io.github.yanndroid/oneui/${{ needs.versions.outputs.version }}).