mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-13 17:19:38 -04:00
Rename nightly packages to show date instead of revsion ID (#893)
Fixes https://github.com/kiwix/k8s/issues/50 for Kiwix JS.
This commit is contained in:
parent
9a6e6f7add
commit
13afb90d95
13
.github/workflows/Release.yml
vendored
13
.github/workflows/Release.yml
vendored
@ -13,6 +13,11 @@ on:
|
|||||||
- cron: '37 1 * * *'
|
- cron: '37 1 * * *'
|
||||||
# Allows us to run this workflow manually from the Actions tab
|
# Allows us to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: Do you wish to build release or nightly?
|
||||||
|
required: false
|
||||||
|
default: 'nightly'
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
@ -51,14 +56,20 @@ jobs:
|
|||||||
MOZILLA_API_SECRET: ${{ secrets.MOZILLA_API_SECRET }}
|
MOZILLA_API_SECRET: ${{ secrets.MOZILLA_API_SECRET }}
|
||||||
MOZILLA_API_KEY: ${{ secrets.MOZILLA_API_KEY }}
|
MOZILLA_API_KEY: ${{ secrets.MOZILLA_API_KEY }}
|
||||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||||
|
CRON_LAUNCHED: ${{ github.event.schedule }}
|
||||||
|
INPUT_TARGET: ${{ github.event.inputs.target }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# Switch -t indicates a tag release (public release); add -d for dry run (for testing)
|
# Switch -t indicates a tag release (public release); add -d for dry run (for testing)
|
||||||
# BEFORE the -v switch (because $TAG_NAME is empty for non-public builds)
|
# BEFORE the -v switch (because $TAG_NAME is empty for non-public builds)
|
||||||
run: |
|
run: |
|
||||||
|
# If user dispateched with "nightly", simulate a CRON run
|
||||||
|
if [ "$INPUT_TARGET" = "nightly" ]; then
|
||||||
|
CRON_LAUNCHED="nightly"
|
||||||
|
fi
|
||||||
# Run xvfb to make Chrome/Chromium believe it has a display. Else it fails signing the package
|
# Run xvfb to make Chrome/Chromium believe it has a display. Else it fails signing the package
|
||||||
Xvfb -ac :99 -screen 0 1280x1024x16 &
|
Xvfb -ac :99 -screen 0 1280x1024x16 &
|
||||||
export DISPLAY=:99
|
export DISPLAY=:99
|
||||||
if [ "x$TAG_NAME" = "x" ]; then
|
if [ -z "$TAG_NAME" ]; then
|
||||||
./scripts/create_all_packages.sh
|
./scripts/create_all_packages.sh
|
||||||
else
|
else
|
||||||
./scripts/create_all_packages.sh -t -v "$TAG_NAME"
|
./scripts/create_all_packages.sh -t -v "$TAG_NAME"
|
||||||
|
@ -24,10 +24,10 @@ if [ -r "$BASEDIR/scripts/set_secret_environment_variables.sh" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Use the passed version number, else use the commit id
|
# Use the passed version number, else use the commit id
|
||||||
if [ ! "${VERSION}zz" == "zz" ]; then
|
if [ -n "${VERSION}" ]; then
|
||||||
echo "Packaging version $VERSION because it has been passed as an argument"
|
echo "Packaging version $VERSION because it has been passed as an argument"
|
||||||
VERSION_FOR_MOZILLA_MANIFEST="$VERSION"
|
VERSION_FOR_MOZILLA_MANIFEST="$VERSION"
|
||||||
if [ ! "${TAG}zz" == "zz" ]; then
|
if [ -n "${TAG}" ]; then
|
||||||
echo "This version is a tag : we're releasing a public version"
|
echo "This version is a tag : we're releasing a public version"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -37,7 +37,7 @@ else
|
|||||||
# and we have to comply with their version string : https://developer.mozilla.org/en-US/docs/Mozilla/Toolkit_version_format
|
# and we have to comply with their version string : https://developer.mozilla.org/en-US/docs/Mozilla/Toolkit_version_format
|
||||||
# So we need to replace every number of the commit id by another string (with 32 cars max)
|
# So we need to replace every number of the commit id by another string (with 32 cars max)
|
||||||
# We are allowed only a few special caracters : +*.-_ so we prefered to use capital letters
|
# We are allowed only a few special caracters : +*.-_ so we prefered to use capital letters
|
||||||
# (hopping this string is case-sensitive)
|
# (hoping this string is case-sensitive)
|
||||||
COMMIT_ID_FOR_MOZILLA_MANIFEST=$(echo $COMMIT_ID | tr '[0123456789]' '[ABCDEFGHIJ]')
|
COMMIT_ID_FOR_MOZILLA_MANIFEST=$(echo $COMMIT_ID | tr '[0123456789]' '[ABCDEFGHIJ]')
|
||||||
VERSION_FOR_MOZILLA_MANIFEST="${MAJOR_NUMERIC_VERSION}commit${COMMIT_ID_FOR_MOZILLA_MANIFEST}"
|
VERSION_FOR_MOZILLA_MANIFEST="${MAJOR_NUMERIC_VERSION}commit${COMMIT_ID_FOR_MOZILLA_MANIFEST}"
|
||||||
echo "Packaging version $VERSION"
|
echo "Packaging version $VERSION"
|
||||||
@ -76,10 +76,17 @@ cp -f ubuntu_touch/* tmp/
|
|||||||
sed -i -e "s/$VERSION_TO_REPLACE/$VERSION/" tmp/manifest.json
|
sed -i -e "s/$VERSION_TO_REPLACE/$VERSION/" tmp/manifest.json
|
||||||
scripts/package_ubuntu_touch_app.sh $DRYRUN $TAG -v $VERSION
|
scripts/package_ubuntu_touch_app.sh $DRYRUN $TAG -v $VERSION
|
||||||
|
|
||||||
if [ "${DRYRUN}zz" == "zz" ]; then
|
if [ -z "${DRYRUN}" ]; then
|
||||||
# Change permissions on source files to match those expected by the server
|
# Change permissions on source files to match those expected by the server
|
||||||
chmod 644 build/*
|
chmod 644 build/*
|
||||||
CURRENT_DATE=$(date +'%Y-%m-%d')
|
CURRENT_DATE=$(date +'%Y-%m-%d')
|
||||||
|
if [ -n "${CRON_LAUNCHED}" ]; then
|
||||||
|
# It's a nightly build, so rename files to include the date and remove extraneous info so that permalinks can be generated
|
||||||
|
for file in build/*; do
|
||||||
|
target=$(sed -E "s/-[0-9.]+commit[^.]+/_$CURRENT_DATE/" <<<"$file")
|
||||||
|
mv "$file" "$target"
|
||||||
|
done
|
||||||
|
fi
|
||||||
# Upload the files on master.download.kiwix.org
|
# Upload the files on master.download.kiwix.org
|
||||||
echo "Uploading the files on https://download.kiwix.org/nightly/$CURRENT_DATE/"
|
echo "Uploading the files on https://download.kiwix.org/nightly/$CURRENT_DATE/"
|
||||||
echo "mkdir /data/download/nightly/$CURRENT_DATE" | sftp -P 30022 -o StrictHostKeyChecking=no -i ./scripts/ssh_key ci@master.download.kiwix.org
|
echo "mkdir /data/download/nightly/$CURRENT_DATE" | sftp -P 30022 -o StrictHostKeyChecking=no -i ./scripts/ssh_key ci@master.download.kiwix.org
|
||||||
|
Loading…
x
Reference in New Issue
Block a user