-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix automatic_release.yml (Attempt 4)
- Loading branch information
1 parent
f8537a1
commit 550223c
Showing
2 changed files
with
48 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Create Tag for Release | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
create_tag: | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-update') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
- name: Get version name and code from file | ||
id: get_version | ||
run: | | ||
VERSION_NAME=$(grep 'version-name =' gradle/libs.versions.toml | awk -F'=' '{print $2}' | tr -d ' "') | ||
VERSION_CODE=$(grep 'version-code =' gradle/libs.versions.toml | awk -F'=' '{print $2}' | tr -d ' "') | ||
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | ||
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | ||
- name: Create and push tag | ||
run: | | ||
TAG_NAME="v${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}" | ||
git tag $TAG_NAME | ||
git push origin $TAG_NAME |