Skip to content

Commit

Permalink
i#2323 GA CI: Fix cronbuild version errors and allow manual (#2353)
Browse files Browse the repository at this point in the history
Fixes two problems with cronbuild versions:
+ The version was missing the major and minor: that was on the tag only.
+ The OSX version needs an additional computation to satisfy clang linker
  restrictions.

Allows manual cronbuilds via a blank version.
Applies input build numbers to cronbuilds too so we can manually test
them the same day as a scheduled build.

Moves the scheduled cronbuild to 2am UTC for 9pm EST.

Issue: #2323
  • Loading branch information
derekbruening authored Dec 19, 2020
1 parent 56a4488 commit 9941be2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
81 changes: 41 additions & 40 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@

name: ci-package
on:
# Our weekly cronbuild: 9pm on Fridays.
# Our weekly cronbuild: 9pm EST on Fridays.
# Presumably this is only triggered by this .yml file on the master branch.
schedule:
- cron: '0 21 * * FRI'
- cron: '0 2 * * SAT'
# Manual trigger using the Actions page.
workflow_dispatch:
inputs:
version:
description: 'Package version number'
required: true
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
default: '2.3.99999'
description: 'Package version number (blank for cronbuild)'
required: false
default: ''
build:
description: 'Package build number'
required: true
Expand Down Expand Up @@ -69,18 +68,17 @@ jobs:
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=$((`git log -n 1 --format=%ct` / (60*60*24)))
export GIT_TAG="cronbuild-2.3.${VERSION_NUMBER}"
export VERSION_NUMBER="2.3.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
if [ "${{ github.event.inputs.build }}" -eq 0 ]; then
export VERSION_NUMBER=${{ github.event.inputs.version }}
else
export VERSION_NUMBER=${{ github.event.inputs.version }}-${{ github.event.inputs.build }}
fi
export GIT_TAG="release_${VERSION_NUMBER}"
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${GIT_TAG}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -127,18 +125,19 @@ jobs:
# 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=$((`git log -n 1 --format=%ct` / (60*60*24)))
export GIT_TAG="cronbuild-2.3.${VERSION_NUMBER}"
export PATCHLEVEL=$((`git log -n 1 --format=%ct` / (60*60*24)))
export PATCHLEVEL=$(((PATCHLEVEL %200) + 56))
export VERSION_NUMBER="2.3.${PATCHLEVEL}"
export PREFIX="cronbuild-"
else
if [ "${{ github.event.inputs.build }}" -eq 0 ]; then
export VERSION_NUMBER=${{ github.event.inputs.version }}
else
export VERSION_NUMBER=${{ github.event.inputs.version }}-${{ github.event.inputs.build }}
fi
export GIT_TAG="release_${VERSION_NUMBER}"
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${GIT_TAG}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -180,18 +179,17 @@ jobs:
# 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=$((`git log -n 1 --format=%ct` / (60*60*24)))
export GIT_TAG="cronbuild-2.3.${VERSION_NUMBER}"
export VERSION_NUMBER="2.3.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
if [ "${{ github.event.inputs.build }}" -eq 0 ]; then
export VERSION_NUMBER=${{ github.event.inputs.version }}
else
export VERSION_NUMBER=${{ github.event.inputs.version }}-${{ github.event.inputs.build }}
fi
export GIT_TAG="release_${VERSION_NUMBER}"
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${GIT_TAG}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -243,18 +241,21 @@ jobs:
# 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=$((`git log -n 1 --format=%ct` / (60*60*24)))
export GIT_TAG="cronbuild-2.3.${VERSION_NUMBER}"
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_VERSION_NUMBER="2.3.${OSX_PATCHLEVEL}"
export PREFIX="cronbuild-"
else
if [ "${{ github.event.inputs.build }}" -eq 0 ]; then
export VERSION_NUMBER=${{ github.event.inputs.version }}
else
export VERSION_NUMBER=${{ github.event.inputs.version }}-${{ github.event.inputs.build }}
fi
export GIT_TAG="release_${VERSION_NUMBER}"
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=version_string::${GIT_TAG}"
echo "::set-output name=osx_version_number::${OSX_VERSION_NUMBER}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Create Release
id: create_release
Expand Down Expand Up @@ -295,8 +296,8 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# This action doesn't seem to support a glob so we need the exact name.
asset_path: DrMemory-MacOS-${{ steps.version.outputs.version_number }}.tar.gz
asset_name: DrMemory-MacOS-${{ steps.version.outputs.version_number }}.tar.gz
asset_path: DrMemory-MacOS-${{ steps.version.outputs.osx_version_number }}.tar.gz
asset_name: DrMemory-MacOS-${{ steps.version.outputs.osx_version_number }}.tar.gz
asset_content_type: application/x-gzip

- name: Download Zip
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ if (APPLE)
# clang linker disallows any but major # being >= 256 (1024 for x64) so we do
# mod 200 (we assume we'll never confuse versions 200 apart) and add 56 (to
# distinguish from real releases).
# If we change this we need to also update .github/workflows/ci-package.yml.
math(EXPR VERSION_NUMBER_PATCHLEVEL "(${VERSION_NUMBER_PATCHLEVEL} % 200) + 56")
endif (APPLE)

# N.B.: when updating this, update the git tag in .travis.yml.
# N.B.: When updating this, update all instances in .github/workflows/ci-package.yml.
# We should find a way to share (xref DRi#1565).
set(VERSION_NUMBER_DEFAULT "2.3.${VERSION_NUMBER_PATCHLEVEL}")
# Do not store the default TOOL_VERSION_NUMBER in the cache to prevent a stale one
Expand Down

0 comments on commit 9941be2

Please sign in to comment.