-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update workflow release and version updater
- Loading branch information
Showing
2 changed files
with
56 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,42 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v6 | ||
id: release_drafter | ||
with: | ||
config-name: release-drafter-config.yml | ||
disable-autolabeler: false | ||
commitish: develop | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Extract version | ||
id: version | ||
run: echo "${{ steps.release_drafter.outputs.resolved_version }}" > VERSION | ||
- name: Calculate code | ||
id: code | ||
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: Show version | ||
run: cat gradle/version.properties | ||
|
||
- name: Push auto generated version file | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "automation: update version.properties" | ||
branch: platform/update-version-meta-data | ||
commit_options: '--no-verify --signoff' | ||
file_pattern: 'gradle/version.properties' | ||
repository: . | ||
commit_author: Author <[email protected]> | ||
create_branch: true | ||
push_options: '--force' | ||
skip_fetch: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,45 +2,33 @@ name: version-update | |
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- platform/update-version-meta-data | ||
|
||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
generate-release-file: | ||
version-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: platform/update-version-meta-data | ||
|
||
- name: Extract version | ||
id: version | ||
run: echo "${GITHUB_REF#refs/tags/}" > VERSION | ||
|
||
- name: Calculate version code | ||
id: code | ||
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: Show version | ||
run: cat gradle/version.properties | ||
|
||
- name: Commit version.properties | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add gradle/version.properties | ||
git commit -m "Bump version to $(cat VERSION)" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: develop | ||
directory: . | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
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 | ||
base: develop | ||
labels: "skip-changelog" | ||
assignees: "wax911" | ||
reviewers: "wax911" |