iOS 13.3.5 #20113
This file contains hidden or 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
name: Joplin Continuous Integration | |
on: [push, pull_request] | |
jobs: | |
Main: | |
# We always process server or desktop release tags, because they also publish the release | |
if: github.repository == 'laurent22/joplin' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Do not use unbuntu-latest because it causes `The operation was canceled` failures: | |
# https://github.com/actions/runner-images/issues/6709 | |
os: [macos-13, ubuntu-22.04, windows-2019, ubuntu-22.04-arm] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup build environment | |
uses: ./.github/workflows/shared/setup-build-environment | |
- name: Install Docker Engine | |
# if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v') | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y apt-transport-https | |
sudo apt-get install -y ca-certificates | |
sudo apt-get install -y curl | |
sudo apt-get install -y gnupg | |
sudo apt-get install -y lsb-release | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update || true | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin | |
# Login to Docker only if we're on a server release tag. If we run this on | |
# a pull request it will fail because the PR doesn't have access to | |
# secrets | |
- uses: docker/login-action@v3 | |
if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v') | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Run tests, build and publish Linux and macOS apps | |
if: runner.os == 'Linux' || runner.os == 'macOs' | |
env: | |
APPLE_ASC_PROVIDER: ${{ secrets.APPLE_ASC_PROVIDER }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.APPLE_CSC_LINK }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
IS_CONTINUOUS_INTEGRATION: 1 | |
BUILD_SEQUENCIAL: 1 | |
SERVER_REPOSITORY: joplin/server | |
SERVER_TAG_PREFIX: server | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
run: | | |
"${GITHUB_WORKSPACE}/.github/scripts/run_ci.sh" | |
- name: Build and publish Windows app | |
if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/v') | |
env: | |
CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.WINDOWS_CSC_LINK }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
IS_CONTINUOUS_INTEGRATION: 1 | |
BUILD_SEQUENCIAL: 1 | |
# To ensure that the operations stop on failure, all commands | |
# should be on one line with "&&" in between. | |
run: | | |
yarn install && cd packages/app-desktop && yarn dist | |
# Build and package the Windows app, without publishing it, just to | |
# verify that the build process hasn't been broken. | |
- name: Build Windows app (no publishing) | |
if: runner.os == 'Windows' && !startsWith(github.ref, 'refs/tags/v') | |
env: | |
IS_CONTINUOUS_INTEGRATION: 1 | |
BUILD_SEQUENCIAL: 1 | |
SERVER_REPOSITORY: joplin/server | |
SERVER_TAG_PREFIX: server | |
run: | | |
yarn install && cd packages/app-desktop && yarn dist --publish=never | |
- name: Publish Docker manifest | |
if: runner.os == 'Linux' | |
env: | |
SERVER_REPOSITORY: joplin/server | |
SERVER_TAG_PREFIX: server | |
run: | | |
chmod 700 "${GITHUB_WORKSPACE}/.github/scripts/publish_docker_manifest.sh" | |
"${GITHUB_WORKSPACE}/.github/scripts/publish_docker_manifest.sh" | |
ServerDockerImage: | |
if: github.repository == 'laurent22/joplin' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Do not use unbuntu-latest because it causes `The operation was canceled` failures: | |
# https://github.com/actions/runner-images/issues/6709 | |
os: [ubuntu-22.04, ubuntu-22.04-arm] | |
steps: | |
- name: Install Docker Engine | |
run: | | |
sudo apt-get install -y apt-transport-https | |
sudo apt-get install -y ca-certificates | |
sudo apt-get install -y curl | |
sudo apt-get install -y gnupg | |
sudo apt-get install -y lsb-release | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update || true | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install Yarn | |
run: | | |
# https://yarnpkg.com/getting-started/install | |
corepack enable | |
- name: Build Docker Image | |
env: | |
BUILD_SEQUENCIAL: 1 | |
run: | | |
if [ "$RUNNER_ARCH" == "ARM64" ]; then | |
DOCKER_IMAGE_PLATFORM="linux/arm64" | |
fi | |
echo "RUNNER_OS=$RUNNER_OS" | |
echo "RUNNER_ARCH=$RUNNER_ARCH" | |
echo "DOCKER_IMAGE_PLATFORM=$DOCKER_IMAGE_PLATFORM" | |
# Canvas is only needed for tests and it doesn't build in ARM64 so remove it | |
cd packages/lib | |
yarn remove canvas | |
cd ../.. | |
yarn install | |
yarn buildServerDocker --platform $DOCKER_IMAGE_PLATFORM --tag-name server-v0.0.0 --repository joplin/server | |
# Basic test to ensure that the created build is valid. It should exit with | |
# code 0 if it works. | |
docker run joplin/server:$(dpkg --print-architecture)-0.0.0 node dist/app.js migrate list | |
- name: Check HTTP request | |
run: | | |
# Need to pass environment variables: | |
docker run -p 22300:22300 joplin/server:$(dpkg --print-architecture)-0.0.0 node dist/app.js --env dev & | |
# Wait for server to start | |
sleep 30 | |
# Check if status code is correct | |
# if the actual_status DOES NOT include the expected_status | |
# it exits the process with code 1 | |
expected_status="HTTP/1.1 200 OK" | |
actual_status=$(curl -I -X GET http://localhost:22300/api/ping | head -n 1) | |
if [[ ! "$actual_status" =~ "$expected_status" ]]; then | |
echo 'Failed while checking the status code after request to /api/ping' | |
echo 'expected: ' $expected_status | |
echo 'actual: ' $actual_status | |
exit 1; | |
fi | |
# Check if the body response is correct | |
# if the actual_body is different of expected_body exit with code 1 | |
expected_body='{"status":"ok","message":"Joplin Server is running"}' | |
actual_body=$(curl http://localhost:22300/api/ping) | |
if [[ "$actual_body" != "$expected_body" ]]; then | |
echo 'Failed while checking the body response after request to /api/ping' | |
exit 1; | |
fi | |