Skip to content

Commit

Permalink
chore: read release cycle year and month from file
Browse files Browse the repository at this point in the history
The year and month for the release cycle are now provided from file rather than being read from the
OS.

For an explanation, see the comment in the diff.
  • Loading branch information
jacderida committed Sep 2, 2024
1 parent e8608c1 commit 673bb7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ jobs:
- name: set package version
shell: bash
run: |
current_date=$(date +%Y.%m)
release_year=$(grep 'release-year:' release-cycle-info | awk '{print $2}')
release_month=$(grep 'release-month:' release-cycle-info | awk '{print $2}')
release_cycle=$(grep 'release-cycle:' release-cycle-info | awk '{print $2}')
release_cycle_counter=$(grep 'release-cycle-counter:' release-cycle-info | awk '{print $2}')
version="$current_date.$release_cycle.$release_cycle_counter"
version="$release_year.$release_month.$release_cycle.$release_cycle_counter"
echo "PACKAGE_VERSION=$version" >> $GITHUB_ENV
- name: package release artifacts
Expand Down
5 changes: 3 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,11 @@ package-arch arch:
if [[ -n $PACKAGE_VERSION ]]; then
version="$PACKAGE_VERSION"
else
current_date=$(date +%Y.%m)
release_year=$(grep 'release-year:' release-cycle-info | awk '{print $2}')
release_month=$(grep 'release-month:' release-cycle-info | awk '{print $2}')
release_cycle=$(grep 'release-cycle:' release-cycle-info | awk '{print $2}')
release_cycle_counter=$(grep 'release-cycle-counter:' release-cycle-info | awk '{print $2}')
version="$current_date.$release_cycle.$release_cycle_counter"
version="$release_year.$release_month.$release_cycle.$release_cycle_counter"
fi
architecture="{{arch}}"
zip_filename="${version}.autonomi.${architecture}.zip"
Expand Down
8 changes: 8 additions & 0 deletions release-cycle-info
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# The reason for having the year and month here rather than reading it from the OS is because we
# have two cycles per month, but the RC can be built for the first cycle of the following month, in
# the current month. So for example, you could build the first September RC before the month of
# August ends, hence reading the current date from the OS would give you 08 rather than 09. The same
# thing applies to the year. So, it's simple enough to just define them here.
#
# The release-cycle is the cycle within the current month. It will be 1 or 2. It is set at the
# beginning of the cycle.
#
Expand All @@ -6,5 +12,7 @@
#
# Both of these numbers are used in the packaged version number, which is a collective version
# number for all the released binaries.
release-year: 2024
release-month: 08
release-cycle: 2
release-cycle-counter: 4

0 comments on commit 673bb7c

Please sign in to comment.