-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.66 KB
/
espresso-release.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Espresso (Release)
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release type - major, minor or patch'
required: true
default: 'patch'
options:
- 'major'
- 'minor'
- 'patch'
pull_request:
branches:
- main
defaults:
run:
working-directory: visual-espresso
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: espresso-release
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
# gpg-private-key: ${{ secrets.MVN_CENTRAL_GPG_PRIVATE_KEY }}
# gpg-passphrase: ${{ secrets.MVN_CENTRAL_GPG_PASSPHRASE }}
- name: Set up Git
if: ${{ steps.prep.outputs.tag_name == '' }}
run: |
git config --global user.name "sauce-visual-bot"
git config --global user.email "[email protected]"
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Bump version
id: upgrade
run: |
new_version=$(./gradlew -q bumpVersion -PreleaseType=patch)
echo "version=$new_version" >> "$GITHUB_OUTPUT"
- name: Publish artifact
run: ./gradlew publishToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MVN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MVN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MVN_CENTRAL_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MVN_CENTRAL_GPG_PASSPHRASE }}
- name: Check if .aar is created
run: |
if [ -f visual-espresso/visual/build/outputs/aar/visual-release.aar ]; then
echo "File exists!"
else
echo "File does not exist."
exit 1
fi
#- name: Push new version to Git
# id: push_to_git
# run: |
# tag_name="espresso-${{ steps.upgrade.outputs.version }}"
# git add ./build.gradle
# git commit -m "[release] $tag_name"
# git tag $tag_name
# git push
# git push origin $tag_name
# echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT"
#- name: Github Release
# uses: softprops/action-gh-release@v2
# with:
# fail_on_unmatched_files: true
# tag_name: ${{ steps.push_to_git.outputs.tag_name }}
# files: visual-espresso/visual/build/outputs/aar/visual-release.aar
# generate_release_notes: true