Skip to content

Commit

Permalink
i#2323: Fix cronbuild tag computation (#2354)
Browse files Browse the repository at this point in the history
Adds a source checkout to the release job, needed to run "git log"
to compute the version.

Issue: #2323
  • Loading branch information
derekbruening authored Dec 19, 2020
1 parent 9941be2 commit 04b22ef
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
name: ci-package
on:
# Our weekly cronbuild: 9pm EST on Fridays.
# Presumably this is only triggered by this .yml file on the master branch.
schedule:
- cron: '0 2 * * SAT'
# Manual trigger using the Actions page.
Expand Down Expand Up @@ -71,14 +70,13 @@ jobs:
export VERSION_NUMBER="2.3.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -130,14 +128,13 @@ jobs:
export VERSION_NUMBER="2.3.${PATCHLEVEL}"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -189,7 +186,6 @@ jobs:
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -236,22 +232,27 @@ jobs:
runs-on: ubuntu-16.04

steps:
# We need a checkout to run git log for the version.
- uses: actions/checkout@v2
with:
submodules: true

- name: Get Version
id: version
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="2.3.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export OSX_PATCHLEVEL=$((`git log -n 1 --format=%ct` / (60*60*24)))
export OSX_PATCHLEVEL=$(((PATCHLEVEL %200) + 56))
export OSX_PATCHLEVEL=$(((OSX_PATCHLEVEL % 200) + 56))
export OSX_VERSION_NUMBER="2.3.${OSX_PATCHLEVEL}"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=osx_version_number::${OSX_VERSION_NUMBER}"
Expand Down

0 comments on commit 04b22ef

Please sign in to comment.