-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: staging updates for 1.9 (#4876)
* workflows: disable nightly build Signed-off-by: Patrick Stephens <[email protected]> * workflows: ensure exit success on release check Signed-off-by: Patrick Stephens <[email protected]> * workflows: add debug info Signed-off-by: Patrick Stephens <[email protected]> * workflows: add debug info Signed-off-by: Patrick Stephens <[email protected]> * workflows: add protection for only master tags Signed-off-by: Patrick Stephens <[email protected]> * workflows: get tag name Signed-off-by: Patrick Stephens <[email protected]> * workflows: fix staging image for multiarch Signed-off-by: Patrick Stephens <[email protected]>
- Loading branch information
1 parent
cd5446e
commit 9b0165b
Showing
3 changed files
with
21 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Deploy to staging | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
|
@@ -13,13 +15,13 @@ on: | |
required: true | ||
default: master | ||
target: | ||
description: Only build a specific target | ||
description: Only build a specific target, intended for debug/test/quick builds only. | ||
required: false | ||
default: "" | ||
|
||
# Run nightly build | ||
schedule: | ||
- cron: "0 6 * * *" | ||
# Run nightly build - disable until after 1.9 release | ||
# schedule: | ||
# - cron: "0 6 * * *" | ||
|
||
# We do not want a new staging build to run whilst we are releasing the current staging build. | ||
# We also do not want multiples to run for the same version. | ||
|
@@ -38,24 +40,26 @@ jobs: | |
version: ${{ steps.formatted_version.outputs.replaced }} | ||
date: ${{ steps.date.outputs.date }} | ||
steps: | ||
# This step is to consolidate the three different triggers into a single "version" | ||
# 1. If manual dispatch - use the version provided. | ||
# 2. If cron/regular build - use master. | ||
# 3. If tag trigger, use that tag. | ||
- name: Get the version | ||
id: get_version | ||
# Use the input variable if defined, if not attempt to get a tag | ||
run: | | ||
VERSION="${INPUT_VERSION}" | ||
if [ -z "${VERSION}" ]; then | ||
if [ -z "${GITHUB_REF/refs\/tags\//}" ]; then | ||
VERSION="${GITHUB_REF/refs\/tags\//}" | ||
else | ||
echo "Defaulting to master" | ||
VERSION=master | ||
fi | ||
echo "Defaulting to master" | ||
VERSION=master | ||
fi | ||
echo ::set-output name=VERSION::$VERSION | ||
shell: bash | ||
env: | ||
INPUT_VERSION: ${{ github.event.inputs.version || '' }} | ||
# Use the dispatch variable in preference, if empty use the context ref_name which should | ||
# only ever be a tag or the master branch for cron builds. | ||
INPUT_VERSION: ${{ github.event.inputs.version || github.ref_name }} | ||
|
||
# String the 'v' prefix for tags. | ||
- uses: frabert/[email protected] | ||
id: formatted_version | ||
with: | ||
|
@@ -64,6 +68,7 @@ jobs: | |
replace-with: '$1' | ||
flags: 'g' | ||
|
||
# For cron builds, i.e. nightly, we provide date and time as extra parameter to distinguish them. | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date '+%Y-%m-%d-%H_%M_%S')" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters