From a4d9a675c26199af5f81ec2c776547f6d606d75d Mon Sep 17 00:00:00 2001 From: Artem Chepurnyi Date: Sat, 2 Nov 2024 21:53:58 +0200 Subject: [PATCH] chore: Switch to a new v1.6.4-20241102 release naming schema --- .github/convert_tag_release_name.py | 18 ------------------ .github/get_release_name.py | 18 ++++++++++++++++++ .github/workflows/new_tag_release.yaml | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 .github/convert_tag_release_name.py create mode 100644 .github/get_release_name.py diff --git a/.github/convert_tag_release_name.py b/.github/convert_tag_release_name.py deleted file mode 100644 index 595a920e..00000000 --- a/.github/convert_tag_release_name.py +++ /dev/null @@ -1,18 +0,0 @@ -import argparse -import re - -from datetime import datetime - -parser = argparse.ArgumentParser("convert_tag_release_name") -parser.add_argument("tag", help="Release tag", type=str) -args = parser.parse_args() - -tag = args.tag -# A format of the tag is r+yyyyMMdd, we -# strip out any non digit symbols here. -date_str = re.match(r'[^\d]*(\d+).*', tag).group(1) -date = datetime.strptime(date_str, '%Y%m%d') - -# Release date name. -out = "{:%Y.%m.%d}".format(date) -print(out) diff --git a/.github/get_release_name.py b/.github/get_release_name.py new file mode 100644 index 00000000..1d3bcbd0 --- /dev/null +++ b/.github/get_release_name.py @@ -0,0 +1,18 @@ +import argparse +import re + +parser = argparse.ArgumentParser("convert_tag_release_name") +parser.add_argument("tag", help="Release tag", type=str) +args = parser.parse_args() + +tag = args.tag +# A format of the tag is r00000000.0 +tag_formatted = re.match(r'[^\d]*([\d\.]+).*', tag).group(1) + +with open("gradle/libs.versions.toml", mode="r") as file: + toml = file.read() + version = re.search(r'appVersionName\s*=\s*"(.*)"', toml).group(1) + +# Release name +out = f"v{version}-{tag_formatted}" +print(out) diff --git a/.github/workflows/new_tag_release.yaml b/.github/workflows/new_tag_release.yaml index c6c32f60..271235f6 100644 --- a/.github/workflows/new_tag_release.yaml +++ b/.github/workflows/new_tag_release.yaml @@ -296,13 +296,13 @@ jobs: path: artifacts - id: vars run: | - date=$(python .github/convert_tag_release_name.py tag=${{ github.ref_name }}) - echo "date=$date" >> $GITHUB_OUTPUT + release_name=$(python .github/get_release_name.py tag=${{ github.ref_name }}) + echo "release_name=release_name" >> $GITHUB_OUTPUT - name: "Create release" uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - name: Release ${{ steps.vars.outputs.date }} + name: Release ${{ steps.vars.outputs.release_name }} body: ${{ steps.changelog.outputs.changelog }} token: ${{ secrets.PERSONAL_TOKEN }} files: |