2021-06-10 14:01:55 +02:00
|
|
|
name: Joplin Continuous Integration
|
2021-06-11 00:24:44 +02:00
|
|
|
on: [push, pull_request]
|
2021-06-10 14:01:55 +02:00
|
|
|
jobs:
|
|
|
|
Main:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-07-09 18:50:12 +02:00
|
|
|
os: [macos-latest, ubuntu-latest, windows-2016]
|
2021-06-10 14:01:55 +02:00
|
|
|
steps:
|
|
|
|
|
|
|
|
# Silence apt-get update errors (for example when a module doesn't
|
|
|
|
# exist) since otherwise it will make the whole build fails, even though
|
|
|
|
# it might work without update. libsecret-1-dev is required for keytar -
|
|
|
|
# https://github.com/atom/node-keytar
|
2021-06-11 18:24:59 +02:00
|
|
|
|
2021-06-10 14:01:55 +02:00
|
|
|
- name: Install Linux dependencies
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update || true
|
|
|
|
sudo apt-get install -y gettext
|
|
|
|
sudo apt-get install -y libsecret-1-dev
|
2021-11-08 19:10:33 +02:00
|
|
|
sudo apt-get install -y translate-toolkit
|
|
|
|
|
|
|
|
- name: Install macOS dependencies
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: |
|
|
|
|
brew update
|
|
|
|
brew install gettext
|
|
|
|
brew install translate-toolkit
|
2021-06-10 14:01:55 +02:00
|
|
|
|
2021-06-11 18:24:59 +02:00
|
|
|
- name: Install Docker Engine
|
2021-11-30 17:37:07 +02:00
|
|
|
# if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v')
|
|
|
|
if: runner.os == 'Linux'
|
2021-06-11 18:24:59 +02:00
|
|
|
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=amd64 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
|
|
|
|
|
2021-06-10 14:01:55 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: olegtarasov/get-tag@v2.1
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-08-12 18:21:57 +02:00
|
|
|
node-version: '16'
|
2021-06-11 18:24:59 +02:00
|
|
|
|
2021-06-12 08:52:09 +02:00
|
|
|
# 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
|
2021-06-11 18:24:59 +02:00
|
|
|
- uses: docker/login-action@v1
|
2021-06-12 08:52:09 +02:00
|
|
|
if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v')
|
2021-06-11 18:24:59 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-06-10 14:01:55 +02:00
|
|
|
|
2021-07-09 18:50:12 +02:00
|
|
|
- name: Run tests, build and publish Linux and macOS apps
|
|
|
|
if: runner.os == 'Linux' || runner.os == 'macOs'
|
2021-06-10 14:01:55 +02:00
|
|
|
env:
|
|
|
|
APPLE_ASC_PROVIDER: ${{ secrets.APPLE_ASC_PROVIDER }}
|
|
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
|
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
2021-07-09 18:50:12 +02:00
|
|
|
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}
|
|
|
|
CSC_LINK: ${{ secrets.APPLE_CSC_LINK }}
|
2021-06-10 14:01:55 +02:00
|
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
2021-06-10 17:43:09 +02:00
|
|
|
IS_CONTINUOUS_INTEGRATION: 1
|
2021-06-10 14:01:55 +02:00
|
|
|
run: |
|
|
|
|
"${GITHUB_WORKSPACE}/.github/scripts/run_ci.sh"
|
2021-07-09 18:50:12 +02:00
|
|
|
|
|
|
|
- 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
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
cd packages/app-desktop
|
|
|
|
npm run dist
|