From 96b04a9bf63a555a55cb1fcfe85349f140751333 Mon Sep 17 00:00:00 2001 From: saicharankandukuri Date: Thu, 19 Dec 2024 22:05:15 +0530 Subject: [PATCH] fix: version logic + re-enable builds for noble & jammy --- .../workflows/anchor-build-and-release.yml | 22 ++++++++++++------- .github/workflows/build-and-release.yml | 22 ++++++++++++------- suites/jammy/.no-matrix-build | 1 - suites/noble/.no-matrix-build | 1 - 4 files changed, 28 insertions(+), 18 deletions(-) delete mode 100644 suites/jammy/.no-matrix-build delete mode 100644 suites/noble/.no-matrix-build diff --git a/.github/workflows/anchor-build-and-release.yml b/.github/workflows/anchor-build-and-release.yml index 0682323..34ccb8c 100644 --- a/.github/workflows/anchor-build-and-release.yml +++ b/.github/workflows/anchor-build-and-release.yml @@ -61,14 +61,20 @@ jobs: udroid_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ https://github.com/RandomCoderOrg/ubuntu-on-android \ | tail -n1 | cut -d / -f 3 | cut -d v -f 2- ) - - udroid_download=$( - git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ - https://github.com/RandomCoderOrg/udroid-download \ - | tail -n1 | cut -d / -f 3 - ) - - echo "VERSIONTAG=V${udroid_version}${BUILD_TYPE}R$((${udroid_download: -2} + 1))" >> $GITHUB_ENV + + latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ + https://github.com/RandomCoderOrg/udroid-download \ + | tail -n1 | cut -d / -f 3) + + if [[ $latest_tag =~ R([0-9]+)$ ]]; then + current_release=${BASH_REMATCH[1]} + else + current_release=0 + fi + + next_release=$((current_release + 1)) + + echo "VERSIONTAG=V${udroid_version}ABR${next_release}" >> $GITHUB_ENV - name: 📝 Generate Release Notes run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 2102f2d..b42992c 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -68,14 +68,20 @@ jobs: udroid_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ https://github.com/RandomCoderOrg/ubuntu-on-android \ | tail -n1 | cut -d / -f 3 | cut -d v -f 2- ) - - udroid_download=$( - git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ - https://github.com/RandomCoderOrg/udroid-download \ - | tail -n1 | cut -d / -f 3 - ) - - echo "VERSIONTAG=V${udroid_version}${BUILD_TYPE}R$((${udroid_download: -2} + 1))" >> $GITHUB_ENV + + latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ + https://github.com/RandomCoderOrg/udroid-download \ + | tail -n1 | cut -d / -f 3) + + if [[ $latest_tag =~ R([0-9]+)$ ]]; then + current_release=${BASH_REMATCH[1]} + else + current_release=0 + fi + + next_release=$((current_release + 1)) + + echo "VERSIONTAG=V${udroid_version}ABR${next_release}" >> $GITHUB_ENV - name: 📝 Generate Release Notes run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh diff --git a/suites/jammy/.no-matrix-build b/suites/jammy/.no-matrix-build deleted file mode 100644 index 42625db..0000000 --- a/suites/jammy/.no-matrix-build +++ /dev/null @@ -1 +0,0 @@ -prevents this distro from building in github actions diff --git a/suites/noble/.no-matrix-build b/suites/noble/.no-matrix-build deleted file mode 100644 index 42625db..0000000 --- a/suites/noble/.no-matrix-build +++ /dev/null @@ -1 +0,0 @@ -prevents this distro from building in github actions