-
-
Notifications
You must be signed in to change notification settings - Fork 26
66 lines (57 loc) · 1.98 KB
/
version-updater.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
name: version-update
on:
repository_dispatch:
types: [version-update-and-push]
permissions:
contents: read
jobs:
version-update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: develop
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Configure properties
run: bash .github/scripts/setup-config.sh
- name: Extract version information to file
run: echo "${{ github.event.client_payload.version }}" > VERSION
- name: Create version.properties using extracted version
run: |
IFS='.' read -ra VER <<< "$(cat VERSION)"
MAJOR=$((VER[0] * 1000000000))
MINOR=$((VER[1] * 1000000))
PATCH=$((VER[2] * 1000))
CODE=$((MAJOR + MINOR + PATCH))
echo "version=$(cat VERSION)" > gradle/version.properties
echo "code=$CODE" >> gradle/version.properties
echo "name=v$(cat VERSION)" >> gradle/version.properties
- name: Clean up version information file
run: rm VERSION
- name: Preview created version.properties
run: cat gradle/version.properties
- name: Generate version.json
run: ./gradlew generateVersions
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
signoff: true
delete-branch: true
commit-message: "automation: update version.properties"
author: "Author <[email protected]>"
title: "platform: automated version update"
body: |
This PR was automatically generated to update `version.properties`
branch: platform/update-version-meta-data
labels: "skip-changelog"
assignees: "wax911"
reviewers: "wax911"