-
-
Notifications
You must be signed in to change notification settings - Fork 130
56 lines (56 loc) · 2.58 KB
/
release-update.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
name: Release update
on:
workflow_dispatch:
jobs:
release-update:
runs-on: ubuntu-latest
if: github.repository == 'patrykandpatrick/vico'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
path: vico
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
- uses: gradle/gradle-build-action@v2
- run: |
git config --global user.email "[email protected]"
git config --global user.name "Patryk & Patrick Bot"
git clone https://${{ secrets.BOT_PAT }}@github.com/patrykandpatrick/patrykandpatrick.com
cd ${{ github.workspace }}/vico
VERSION_NAME=$(grep -oP "(?<=version_name).*(?=\",)" versions.gradle | grep -oP "(?<=\").*")
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "TAG_NAME=v$VERSION_NAME" >> $GITHUB_ENV
IS_PRERELEASE=false
echo $VERSION_NAME | grep -q "alpha\|beta" && IS_PRERELEASE=true
echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
./gradlew assembleDebug
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
token: ${{ secrets.BOT_PAT }}
prerelease: ${{ env.IS_PRERELEASE }}
draft: true
files: ${{ github.workspace }}/vico/sample/build/outputs/apk/debug/*.apk
- run: |
cd ${{ github.workspace }}/vico
git remote set-url origin https://patrykandpatrickbot:${{ secrets.BOT_PAT }}@github.com/patrykandpatrick/vico.git
./gradlew dokkaHtmlMultiModule
API_REFERENCE_DESTINATION=${{ github.workspace }}/patrykandpatrick.com/src/vico/api/$(if $IS_PRERELEASE; then echo $VERSION_NAME; else echo main; fi)
rm -fr $API_REFERENCE_DESTINATION/*
cp -R ${{ github.workspace }}/vico/vico/build/dokka/htmlMultiModule/. $API_REFERENCE_DESTINATION
cd ${{ github.workspace }}/patrykandpatrick.com
git remote set-url origin https://patrykandpatrickbot:${{ secrets.BOT_PAT }}@github.com/patrykandpatrick/patrykandpatrick.com.git
git add src/vico/api
git diff --staged --quiet HEAD || git commit -m "Update Vico API reference"
git push origin
cd ${{ github.workspace }}/vico
git push origin
./gradlew publish
env:
ORG_GRADLE_PROJECT_GPG_KEY: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}