added build and publish backend docker on CI
This commit is contained in:
parent
2c1bceec52
commit
57644fa8fd
17 changed files with 580 additions and 38 deletions
25
.github/workflows/ci_backend.yml
vendored
25
.github/workflows/ci_backend.yml
vendored
|
@ -35,9 +35,9 @@ jobs:
|
|||
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
|
||||
|
||||
DO_PUBLISH='false'
|
||||
if [[ "${{ github.event.inputs.publish }}" == "on" ]]; then DO_PUBLISH='true'; fi
|
||||
if [ -z "${{ secrets.S3_KEY_CONVERTOR }}" ]; then DO_PUBLISH='false'; fi
|
||||
if [ -z "${{ secrets.S3_SECRET_CONVERTOR }}" ]; then DO_PUBLISH='false'; fi
|
||||
if [ "${{ github.event.inputs.publish }}" = "on" ]; then DO_PUBLISH='true'; fi
|
||||
if [ -z "${{ secrets.S3_KEY_CONVERTER }}" ]; then DO_PUBLISH='false'; fi
|
||||
if [ -z "${{ secrets.S3_SECRET_CONVERTER }}" ]; then DO_PUBLISH='false'; fi
|
||||
|
||||
bash ./build/ci/tools/make_version_env.sh $BUILD_NUMBER
|
||||
VERSION=$(cat ./build.artifacts/env/build_version.env)
|
||||
|
@ -48,8 +48,6 @@ jobs:
|
|||
echo "BUILD_MODE: $BUILD_MODE"
|
||||
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
|
||||
echo "BUILD_NUMBER: $BUILD_NUMBER"
|
||||
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
|
||||
echo "DO_BUILD: $DO_BUILD"
|
||||
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
|
||||
echo "DO_PUBLISH: $DO_PUBLISH"
|
||||
echo "GITHUB_ARTIFACT_NAME=$GITHUB_ARTIFACT_NAME" >> $GITHUB_ENV
|
||||
|
@ -58,16 +56,29 @@ jobs:
|
|||
- name: Setup environment
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/setup.sh
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/build.sh -n ${{ env.BUILD_NUMBER }} --build_videoexport
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/package.sh
|
||||
- name: Publish package
|
||||
|
||||
- name: Publish to S3
|
||||
if: env.DO_PUBLISH == 'true'
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/publish.sh --s3_key ${{ secrets.S3_KEY_CONVERTER }} --s3_secret ${{ secrets.S3_SECRET_CONVERTER }}
|
||||
sudo bash ./build/ci/backend/publish_to_s3.sh --s3_key ${{ secrets.S3_KEY_CONVERTER }} --s3_secret ${{ secrets.S3_SECRET_CONVERTER }}
|
||||
|
||||
- name: Build Docker
|
||||
if: env.DO_PUBLISH == 'true'
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/build_docker.sh
|
||||
|
||||
- name: Publish to Registry
|
||||
if: env.DO_PUBLISH == 'true'
|
||||
run: |
|
||||
sudo bash ./build/ci/backend/publish_to_registry.sh --token ${{ secrets.PACKAGES_PAT }}
|
||||
|
||||
- name: Upload artifacts on GitHub
|
||||
if: ${{ always() }}
|
||||
|
|
58
build/ci/backend/build_docker.sh
Normal file
58
build/ci/backend/build_docker.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Build Docker MuseScore"
|
||||
|
||||
HERE="$(dirname ${BASH_SOURCE[0]})"
|
||||
ORIGIN_DIR=${PWD}
|
||||
ARTIFACTS_DIR=build.artifacts
|
||||
DOCKER_WORK_DIR=$ARTIFACTS_DIR/docker
|
||||
MU_VERSION=""
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
|
||||
# Make MU docker files
|
||||
echo "Prepare Docker files"
|
||||
mkdir -p $DOCKER_WORK_DIR
|
||||
|
||||
cp $HERE/docker/Dockerfile $DOCKER_WORK_DIR/Dockerfile
|
||||
cp $HERE/docker/setup.sh $DOCKER_WORK_DIR/setup.sh
|
||||
cp $HERE/docker/install_mu_template.sh $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
sed -i 's|x.x.x.xxxxxx|'${MU_VERSION}'|' $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
|
||||
cd $DOCKER_WORK_DIR
|
||||
echo "Build Docker"
|
||||
docker build -t ghcr.io/musescore/converter_4:${MU_VERSION} .
|
||||
cd $ORIGIN_DIR
|
||||
|
||||
echo "Done!!"
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
FROM library/ubuntu:20.04
|
||||
ENV TZ=Etc/UTC DEBIAN_FRONTEND=noninteractive
|
||||
COPY setup.sh /setup.sh
|
||||
COPY install_mu.sh /install_mu.sh
|
||||
RUN bash -ex setup.sh
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
S3_URL=https://s3.amazonaws.com/convertor.musescore.org
|
||||
MU_DIR=/musescore
|
||||
|
||||
mkdir -p $MU_DIR
|
||||
|
||||
# MU2
|
||||
echo "=== Install MuseScore 2 ==="
|
||||
MU2_DISTRO=MuseScore-2.3.2.2022021712
|
||||
wget -q --show-progress -O $MU_DIR/$MU2_DISTRO.7z "$S3_URL/$MU2_DISTRO.7z"
|
||||
mkdir $MU_DIR/$MU2_DISTRO
|
||||
7z x -y $MU_DIR/$MU2_DISTRO.7z -o"$MU_DIR/$MU2_DISTRO/"
|
||||
$MU_DIR/$MU2_DISTRO/convertor -v
|
||||
|
||||
# MU3
|
||||
echo "=== Install MuseScore 3 ==="
|
||||
MU3_DISTRO=MuseScore-3.6.2.1853151055
|
||||
wget -q --show-progress -O $MU_DIR/$MU3_DISTRO.7z "$S3_URL/$MU3_DISTRO.7z"
|
||||
mkdir $MU_DIR/$MU3_DISTRO
|
||||
7z x -y $MU_DIR/$MU3_DISTRO.7z -o"$MU_DIR/$MU3_DISTRO/"
|
||||
$MU_DIR/$MU3_DISTRO/convertor -v
|
||||
|
||||
# MU4
|
||||
echo "=== Install MuseScore 4 ==="
|
||||
MU4_DISTRO=MuseScore-4.0.0.1853159646
|
||||
wget -q --show-progress -O $MU_DIR/$MU4_DISTRO.7z "$S3_URL/$MU4_DISTRO.7z"
|
||||
mkdir $MU_DIR/$MU4_DISTRO
|
||||
7z x -y $MU_DIR/$MU4_DISTRO.7z -o"$MU_DIR/$MU4_DISTRO"
|
||||
$MU_DIR/$MU4_DISTRO/convertor -v
|
||||
|
14
build/ci/backend/docker/install_mu_template.sh
Normal file
14
build/ci/backend/docker/install_mu_template.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
S3_URL=https://s3.amazonaws.com/convertor.musescore.org
|
||||
MU_DIR=/musescore
|
||||
MU_VERSION=x.x.x.xxxxxx
|
||||
|
||||
mkdir -p $MU_DIR
|
||||
|
||||
echo "=== Install MuseScore ${MU_VERSION} ==="
|
||||
MU_DISTRO=MuseScore-${MU_VERSION}
|
||||
wget -q --show-progress -O $MU_DIR/$MU_DISTRO.7z "$S3_URL/$MU_DISTRO.7z"
|
||||
7z x -y $MU_DIR/$MU_DISTRO.7z -o"$MU_DIR/"
|
||||
$MU_DIR/convertor -v
|
||||
|
5
build/ci/backend/docker/mu2/Dockerfile
Normal file
5
build/ci/backend/docker/mu2/Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM library/ubuntu:18.04
|
||||
ENV TZ=Etc/UTC DEBIAN_FRONTEND=noninteractive
|
||||
COPY setup.sh /setup.sh
|
||||
COPY install_mu.sh /install_mu.sh
|
||||
RUN bash -ex setup.sh
|
58
build/ci/backend/docker/mu2/build_docker.sh
Normal file
58
build/ci/backend/docker/mu2/build_docker.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Build Docker MuseScore"
|
||||
|
||||
HERE="$(dirname ${BASH_SOURCE[0]})"
|
||||
ORIGIN_DIR=${PWD}
|
||||
ARTIFACTS_DIR=build.artifacts
|
||||
DOCKER_WORK_DIR=$ARTIFACTS_DIR/docker
|
||||
MU_VERSION="2.3.2.2022051117"
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
|
||||
# Make MU docker files
|
||||
echo "Prepare Docker files"
|
||||
mkdir -p $DOCKER_WORK_DIR
|
||||
|
||||
cp $HERE/Dockerfile $DOCKER_WORK_DIR/Dockerfile
|
||||
cp $HERE/setup.sh $DOCKER_WORK_DIR/setup.sh
|
||||
cp $HERE/install_mu_template.sh $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
sed -i 's|x.x.x.xxxxxx|'${MU_VERSION}'|' $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
|
||||
cd $DOCKER_WORK_DIR
|
||||
echo "Build Docker"
|
||||
docker build -t ghcr.io/musescore/converter_2:${MU_VERSION} .
|
||||
cd $ORIGIN_DIR
|
||||
|
||||
echo "done!!"
|
||||
|
17
build/ci/backend/docker/mu2/install_mu_template.sh
Normal file
17
build/ci/backend/docker/mu2/install_mu_template.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
S3_URL=https://s3.amazonaws.com/convertor.musescore.org
|
||||
MU_DIR=/musescore
|
||||
MU_VERSION=x.x.x.xxxxxx
|
||||
|
||||
mkdir -p $MU_DIR
|
||||
|
||||
echo "=== Install MuseScore ${MU_VERSION} ==="
|
||||
MU_DISTRO=MuseScore-${MU_VERSION}
|
||||
wget -q --show-progress -O $MU_DIR/$MU_DISTRO.7z "$S3_URL/$MU_DISTRO.7z"
|
||||
7z x -y $MU_DIR/$MU_DISTRO.7z -o"$MU_DIR/"
|
||||
ls $MU_DIR
|
||||
echo "Check run:"
|
||||
$MU_DIR/convertor -v
|
||||
echo "Done!!"
|
||||
|
51
build/ci/backend/docker/mu2/publish_to_registry.sh
Normal file
51
build/ci/backend/docker/mu2/publish_to_registry.sh
Normal file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Publish Docker MuseScore"
|
||||
|
||||
HERE="$(dirname ${BASH_SOURCE[0]})"
|
||||
MU_VERSION="2.3.2.2022051117"
|
||||
ACCESS_USER="igorkorsukov" # For test, should be replaced with muse-bot
|
||||
ACCESS_TOKEN=$GITHUB_TOKEN
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
-t|--token) ACCESS_TOKEN="$2"; shift ;;
|
||||
-u|--user) ACCESS_USER="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_TOKEN" ]; then echo "Error: Token not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_USER" ]; then echo "Error: User not set"; exit 1; fi
|
||||
|
||||
echo "Login Docker"
|
||||
echo $ACCESS_TOKEN | docker login ghcr.io -u $ACCESS_USER --password-stdin
|
||||
|
||||
echo "Push Docker"
|
||||
docker push ghcr.io/musescore/converter_2:${MU_VERSION}
|
||||
|
||||
echo "Done!!"
|
||||
|
88
build/ci/backend/docker/mu2/setup.sh
Normal file
88
build/ci/backend/docker/mu2/setup.sh
Normal file
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# For maximum AppImage compatibility, build on the oldest Linux distribution
|
||||
# that still receives security updates from its manufacturer.
|
||||
|
||||
# DEPENDENCES
|
||||
apt_packages_basic=(
|
||||
file
|
||||
software-properties-common
|
||||
p7zip-full
|
||||
)
|
||||
|
||||
apt_packages_standard=(
|
||||
curl
|
||||
libasound2-dev
|
||||
libfontconfig1-dev
|
||||
libfreetype6-dev
|
||||
libfreetype6
|
||||
libgl1-mesa-dev
|
||||
libjack-dev
|
||||
libmp3lame-dev
|
||||
libnss3-dev
|
||||
libportmidi-dev
|
||||
libpulse-dev
|
||||
libsndfile1-dev
|
||||
portaudio19-dev
|
||||
wget
|
||||
)
|
||||
|
||||
apt_packages_runtime=(
|
||||
libcups2
|
||||
libdbus-1-3
|
||||
libegl1-mesa-dev
|
||||
libodbc1
|
||||
libpq-dev
|
||||
libxcomposite-dev
|
||||
libxcursor-dev
|
||||
libxi-dev
|
||||
libxkbcommon-x11-0
|
||||
libxrandr2
|
||||
libxtst-dev
|
||||
libdrm-dev
|
||||
libxcb-icccm4
|
||||
libxcb-image0
|
||||
libxcb-keysyms1
|
||||
libxcb-randr0
|
||||
libxcb-render-util0
|
||||
libxcb-xinerama0
|
||||
xvfb
|
||||
)
|
||||
|
||||
apt_packages_ffmpeg=(
|
||||
ffmpeg
|
||||
libavcodec-dev
|
||||
libavformat-dev
|
||||
libswscale-dev
|
||||
)
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
"${apt_packages_basic[@]}" \
|
||||
"${apt_packages_standard[@]}" \
|
||||
"${apt_packages_runtime[@]}" \
|
||||
"${apt_packages_ffmpeg[@]}"
|
||||
|
||||
|
||||
# DISTROS
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
bash $HERE/install_mu.sh
|
5
build/ci/backend/docker/mu3/Dockerfile
Normal file
5
build/ci/backend/docker/mu3/Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM library/ubuntu:18.04
|
||||
ENV TZ=Etc/UTC DEBIAN_FRONTEND=noninteractive
|
||||
COPY setup.sh /setup.sh
|
||||
COPY install_mu.sh /install_mu.sh
|
||||
RUN bash -ex setup.sh
|
58
build/ci/backend/docker/mu3/build_docker.sh
Normal file
58
build/ci/backend/docker/mu3/build_docker.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Build Docker MuseScore"
|
||||
|
||||
HERE="$(dirname ${BASH_SOURCE[0]})"
|
||||
ORIGIN_DIR=${PWD}
|
||||
ARTIFACTS_DIR=build.artifacts
|
||||
DOCKER_WORK_DIR=$ARTIFACTS_DIR/docker
|
||||
MU_VERSION="3.6.2.2270279339"
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
|
||||
# Make MU docker files
|
||||
echo "Prepare Docker files"
|
||||
mkdir -p $DOCKER_WORK_DIR
|
||||
|
||||
cp $HERE/Dockerfile $DOCKER_WORK_DIR/Dockerfile
|
||||
cp $HERE/setup.sh $DOCKER_WORK_DIR/setup.sh
|
||||
cp $HERE/install_mu_template.sh $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
sed -i 's|x.x.x.xxxxxx|'${MU_VERSION}'|' $DOCKER_WORK_DIR/install_mu.sh
|
||||
|
||||
|
||||
cd $DOCKER_WORK_DIR
|
||||
echo "Build Docker"
|
||||
docker build -t ghcr.io/musescore/converter_3:${MU_VERSION} .
|
||||
cd $ORIGIN_DIR
|
||||
|
||||
echo "Done!!"
|
||||
|
17
build/ci/backend/docker/mu3/install_mu_template.sh
Normal file
17
build/ci/backend/docker/mu3/install_mu_template.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
S3_URL=https://s3.amazonaws.com/convertor.musescore.org
|
||||
MU_DIR=/musescore
|
||||
MU_VERSION=x.x.x.xxxxxx
|
||||
|
||||
mkdir -p $MU_DIR
|
||||
|
||||
echo "=== Install MuseScore ${MU_VERSION} ==="
|
||||
MU_DISTRO=MuseScore-${MU_VERSION}
|
||||
wget -q --show-progress -O $MU_DIR/$MU_DISTRO.7z "$S3_URL/$MU_DISTRO.7z"
|
||||
7z x -y $MU_DIR/$MU_DISTRO.7z -o"$MU_DIR/"
|
||||
ls $MU_DIR
|
||||
echo "Check run:"
|
||||
$MU_DIR/convertor -v
|
||||
echo "Done!!"
|
||||
|
51
build/ci/backend/docker/mu3/publish_to_registry.sh
Normal file
51
build/ci/backend/docker/mu3/publish_to_registry.sh
Normal file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Publish Docker MuseScore"
|
||||
|
||||
HERE="$(dirname ${BASH_SOURCE[0]})"
|
||||
MU_VERSION="3.6.2.2270279339"
|
||||
ACCESS_USER="igorkorsukov" # For test, should be replaced with muse-bot
|
||||
ACCESS_TOKEN=$GITHUB_TOKEN
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
-t|--token) ACCESS_TOKEN="$2"; shift ;;
|
||||
-u|--user) ACCESS_USER="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_TOKEN" ]; then echo "Error: Token not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_USER" ]; then echo "Error: User not set"; exit 1; fi
|
||||
|
||||
echo "Login Docker"
|
||||
echo $ACCESS_TOKEN | docker login ghcr.io -u $ACCESS_USER --password-stdin
|
||||
|
||||
echo "Push Docker"
|
||||
docker push ghcr.io/musescore/converter_3:${MU_VERSION}
|
||||
|
||||
echo "Done!!"
|
||||
|
88
build/ci/backend/docker/mu3/setup.sh
Normal file
88
build/ci/backend/docker/mu3/setup.sh
Normal file
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# For maximum AppImage compatibility, build on the oldest Linux distribution
|
||||
# that still receives security updates from its manufacturer.
|
||||
|
||||
# DEPENDENCES
|
||||
apt_packages_basic=(
|
||||
file
|
||||
software-properties-common
|
||||
p7zip-full
|
||||
)
|
||||
|
||||
apt_packages_standard=(
|
||||
curl
|
||||
libasound2-dev
|
||||
libfontconfig1-dev
|
||||
libfreetype6-dev
|
||||
libfreetype6
|
||||
libgl1-mesa-dev
|
||||
libjack-dev
|
||||
libmp3lame-dev
|
||||
libnss3-dev
|
||||
libportmidi-dev
|
||||
libpulse-dev
|
||||
libsndfile1-dev
|
||||
portaudio19-dev
|
||||
wget
|
||||
)
|
||||
|
||||
apt_packages_runtime=(
|
||||
libcups2
|
||||
libdbus-1-3
|
||||
libegl1-mesa-dev
|
||||
libodbc1
|
||||
libpq-dev
|
||||
libxcomposite-dev
|
||||
libxcursor-dev
|
||||
libxi-dev
|
||||
libxkbcommon-x11-0
|
||||
libxrandr2
|
||||
libxtst-dev
|
||||
libdrm-dev
|
||||
libxcb-icccm4
|
||||
libxcb-image0
|
||||
libxcb-keysyms1
|
||||
libxcb-randr0
|
||||
libxcb-render-util0
|
||||
libxcb-xinerama0
|
||||
xvfb
|
||||
)
|
||||
|
||||
apt_packages_ffmpeg=(
|
||||
ffmpeg
|
||||
libavcodec-dev
|
||||
libavformat-dev
|
||||
libswscale-dev
|
||||
)
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
"${apt_packages_basic[@]}" \
|
||||
"${apt_packages_standard[@]}" \
|
||||
"${apt_packages_runtime[@]}" \
|
||||
"${apt_packages_ffmpeg[@]}"
|
||||
|
||||
|
||||
# DISTROS
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
bash $HERE/install_mu.sh
|
51
build/ci/backend/publish_to_registry.sh
Normal file
51
build/ci/backend/publish_to_registry.sh
Normal file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# MuseScore-CLA-applies
|
||||
#
|
||||
# MuseScore
|
||||
# Music Composition & Notation
|
||||
#
|
||||
# Copyright (C) 2021 MuseScore BVBA and others
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 3 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
echo "Publish Docker MuseScore"
|
||||
|
||||
ARTIFACTS_DIR=build.artifacts
|
||||
MU_VERSION=""
|
||||
ACCESS_USER="igorkorsukov" # For test, should be replaced with muse-bot
|
||||
ACCESS_TOKEN=$GITHUB_TOKEN
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) MU_VERSION="$2"; shift ;;
|
||||
-t|--token) ACCESS_TOKEN="$2"; shift ;;
|
||||
-u|--user) ACCESS_USER="$2"; shift ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then MU_VERSION=$(cat $ARTIFACTS_DIR/env/build_version.env); fi
|
||||
|
||||
if [ -z "$MU_VERSION" ]; then echo "Error: Version not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_TOKEN" ]; then echo "Error: Token not set"; exit 1; fi
|
||||
if [ -z "$ACCESS_USER" ]; then echo "Error: User not set"; exit 1; fi
|
||||
|
||||
echo "Login Docker"
|
||||
echo $ACCESS_TOKEN | docker login ghcr.io -u $ACCESS_USER --password-stdin
|
||||
|
||||
echo "Push Docker"
|
||||
docker push ghcr.io/musescore/converter_4:${MU_VERSION}
|
||||
|
||||
echo "Done!!"
|
||||
|
Loading…
Reference in a new issue