diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index e131334f242..00000000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: automerge -on: - schedule: - - cron: '*/10 * * * *' -jobs: - - # This job will make the action fail if any of the checks hasn't passed - # https://github.com/marketplace/actions/allcheckspassed - # allchecks: - # runs-on: ubuntu-latest - # steps: - # - uses: wechuli/allcheckspassed@v1 - - automerge: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - id: automerge - name: automerge - uses: "pascalgn/automerge-action@v0.16.3" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_METHOD: "squash" - LOG: "DEBUG" diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml deleted file mode 100644 index c553b2315b0..00000000000 --- a/.github/workflows/build-android.yml +++ /dev/null @@ -1,43 +0,0 @@ -# The goal of this action is to compile the Android debug build. That should -# tell us automatically if something got broken when a dependency was changed. - -name: react-native-android-build-apk -on: [push, pull_request] - -jobs: - AssembleRelease: - if: github.repository == 'laurent22/joplin' - runs-on: ubuntu-latest - steps: - - name: Install Linux dependencies - run: | - sudo apt-get update || true - sudo apt-get install -y libsecret-1-dev - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '20' - - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '18' - cache: 'yarn' - - - uses: dtolnay/rust-toolchain@stable - - - name: Install Yarn - run: | - corepack enable - - - name: Install - run: yarn install - - - name: Assemble Android Release - run: | - cd packages/app-mobile/android - sed -i -- 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/' app/build.gradle - ./gradlew assembleRelease - \ No newline at end of file diff --git a/.github/workflows/build-macos-m1.yml b/.github/workflows/build-macos-m1.yml deleted file mode 100644 index 6dbf8b050a6..00000000000 --- a/.github/workflows/build-macos-m1.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Build macOS M1 -on: [push, pull_request] -jobs: - Main: - # We always process desktop release tags, because they also publish the release - if: github.repository == 'laurent22/joplin' - runs-on: macos-latest - steps: - - - uses: actions/checkout@v4 - - uses: olegtarasov/get-tag@v2.1.3 - - uses: actions/setup-node@v4 - with: - # We need to pin the version to 18.15, because 18.16+ fails with this error: - # https://github.com/facebook/react-native/issues/36440 - node-version: '18.15.0' - cache: 'yarn' - - - name: Install Yarn - run: | - # https://yarnpkg.com/getting-started/install - corepack enable - - - name: Install macOs dependencies - if: runner.os == 'macOS' - run: | - # Required for building the canvas package - brew install pango - - # See github-action-main.yml for explanation - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Set Publish Flag - run: | - if [[ $GIT_TAG_NAME = v* ]]; then - echo "PUBLISH_ENABLED=true" >> $GITHUB_ENV - else - echo "PUBLISH_ENABLED=false" >> $GITHUB_ENV - fi - - - name: Build macOS M1 app - 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 }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - IS_CONTINUOUS_INTEGRATION: 1 - BUILD_SEQUENCIAL: 1 - PUBLISH_ENABLED: ${{ env.PUBLISH_ENABLED }} - run: | - export npm_config_arch=arm64 - export npm_config_target_arch=arm64 - yarn install - cd packages/app-desktop - npm pkg set 'build.mac.artifactName'='${productName}-${version}-${arch}.${ext}' - npm pkg set 'build.mac.target[0].target'='dmg' - npm pkg set 'build.mac.target[0].arch[0]'='arm64' - npm pkg set 'build.mac.target[1].target'='zip' - npm pkg set 'build.mac.target[1].arch[0]'='arm64' - - if [[ "$PUBLISH_ENABLED" == "true" ]]; then - echo "Building and publishing desktop application..." - PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 - - yarn modifyReleaseAssets --repo="$GH_REPO" --tag="$GIT_TAG_NAME" --token="$GITHUB_TOKEN" - else - echo "Building but *not* publishing desktop application..." - - # We also want to disable signing the app in this case, because - # it doesn't work and we don't need it. - # https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos - - export CSC_IDENTITY_AUTO_DISCOVERY=false - npm pkg set 'build.mac.identity'=null --json - - PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 --publish=never - fi \ No newline at end of file diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml deleted file mode 100644 index c8f94456602..00000000000 --- a/.github/workflows/check-pr-title.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Check pull request title -on: [pull_request] -jobs: - main: - runs-on: ubuntu-latest - steps: - - uses: Slashgear/action-check-pr-title@v4.3.0 - with: - regexp: "(Desktop|Mobile|All|Cli|Tools|Chore|Clipper|Server|Android|iOS|Plugins|CI|Plugin Repo|Doc): (Fixes|Resolves) #[0-9]+: .+" diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index f2a60e25711..00000000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "CLA Assistant" -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened,closed,synchronize] - -jobs: - CLAAssistant: - if: github.repository == 'laurent22/joplin' - runs-on: ubuntu-latest - steps: - - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - # Beta Release - uses: contributor-assistant/github-action@v2.3.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # the below token should have repo scope and must be manually added by you in the repository's secret - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - with: - path-to-signatures: 'readme/cla_signatures.json' - path-to-document: 'https://github.com/laurent22/joplin/blob/dev/readme/cla.md' # e.g. a CLA or a DCO document - # branch should not be protected - branch: 'cla_signatures' - allowlist: joplinbot,renovate[bot] - - # the followings are the optional inputs - If the optional inputs are not given, then default values will be taken - #remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository) - #remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository) - #create-file-commit-message: 'For example: Creating file for storing CLA Signatures' - #signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo' - #custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign' - #custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA' - #custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.' - lock-pullrequest-aftermerge: false - #use-dco-flag: true - If you are using DCO instead of CLA diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml deleted file mode 100644 index c13172fca6a..00000000000 --- a/.github/workflows/close-stale-issues.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: 'Close stale issues' -on: - schedule: - - cron: '0 16 * * *' -permissions: - issues: write -jobs: - ProcessStaleIssues: - if: github.repository == 'laurent22/joplin' - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - # Use this to do a dry run from a pull request - # debug-only: true - stale-issue-message: "Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the [Joplin forum](https://discourse.joplinapp.org/). This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions." - days-before-stale: 30 - days-before-close: 7 - operations-per-run: 1000 - exempt-issue-labels: 'good first issue,upstream,backlog,high,medium,spec,cannot reproduce,enhancement' - stale-issue-label: 'stale' - close-issue-message: 'Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.' - # Don't process pull requests at all - days-before-pr-stale: -1 diff --git a/.github/workflows/comment-on-failure.yml b/.github/workflows/comment-on-failure.yml deleted file mode 100644 index fbe8579df94..00000000000 --- a/.github/workflows/comment-on-failure.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: comment-on-failure -on: - workflow_run: - workflows: - - Joplin Continuous Integration - - react-native-android-build-apk - - Build macOS M1 - types: [ completed ] - -jobs: - comment-failure: - runs-on: ubuntu-latest - steps: - - uses: quipper/comment-failure-action@v0.1.1 diff --git a/.github/workflows/github-actions-main.yml b/.github/workflows/github-actions-main.yml deleted file mode 100644 index ca2e938271b..00000000000 --- a/.github/workflows/github-actions-main.yml +++ /dev/null @@ -1,223 +0,0 @@ -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-20.04, windows-2019] - steps: - - # Trying to fix random networking issues on Windows - # https://github.com/actions/runner-images/issues/1187#issuecomment-686735760 - - name: Disable TCP/UDP offload on Windows - if: runner.os == 'Windows' - run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6 - - - name: Disable TCP/UDP offload on Linux - if: runner.os == 'Linux' - run: sudo ethtool -K eth0 tx off rx off - - - name: Disable TCP/UDP offload on macOS - if: runner.os == 'macOS' - run: | - sudo sysctl -w net.link.generic.system.hwcksum_tx=0 - sudo sysctl -w net.link.generic.system.hwcksum_rx=0 - - # 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 - - - 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 - sudo apt-get install -y translate-toolkit - sudo apt-get install -y rsync - # Provides a virtual display on Linux. Used for Playwright integration - # testing. - sudo apt-get install -y xvfb - - - name: Install macOs dependencies - if: runner.os == 'macOS' - run: | - # Required for building the canvas package - brew install pango - - - 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=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 - - - uses: actions/checkout@v4 - - uses: olegtarasov/get-tag@v2.1.3 - - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-node@v4 - with: - # We need to pin the version to 18.15, because 18.16+ fails with this error: - # https://github.com/facebook/react-native/issues/36440 - node-version: '18.15.0' - cache: 'yarn' - - - name: Install Yarn - run: | - # https://yarnpkg.com/getting-started/install - corepack enable - - # 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 }} - - # macos-latest ships with Python 3.12 by default, but this removes a - # utility that's used by electron-builder (distutils) so we need to pin - # Python to an earlier version. - # Fixes error `ModuleNotFoundError: No module named 'distutils'` - # Ref: https://github.com/nodejs/node-gyp/issues/2869 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - 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 - - 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-20.04] - 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=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 - - - 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: | - yarn install - yarn buildServerDocker --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:0.0.0-beta node dist/app.js migrate list - - - name: Check HTTP request - run: | - # Need to pass environment variables: - docker run -p 22300:22300 joplin/server:0.0.0-beta 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 - diff --git a/.github/workflows/release-android.yml b/.github/workflows/release-android.yml new file mode 100644 index 00000000000..4c57f88c05c --- /dev/null +++ b/.github/workflows/release-android.yml @@ -0,0 +1,78 @@ +# The goal of this action is to compile the Android debug build. That should +# tell us automatically if something got broken when a dependency was changed. + +name: react-native-android-build-apk +on: [pull_request] + +jobs: + AssembleRelease: + if: github.repository == 'mrjo118/joplin' + runs-on: ubuntu-latest + steps: + - name: Install Linux dependencies + run: | + sudo apt-get update || true + sudo apt-get install -y libsecret-1-dev + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '20' + + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'yarn' + + - uses: dtolnay/rust-toolchain@stable + + - name: Install Yarn + run: | + corepack enable + + - name: Install + run: yarn install + + - name: Assemble Android Release + run: | + cd packages/app-mobile/android + sed -i -- 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/' app/build.gradle + ./gradlew assembleRelease + + - name: version + run: echo "::set-output name=version::$(date +%s)" + id: version + + - name: create tag + uses: actions/github-script@v5 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ steps.version.outputs.version }}', + sha: context.sha + }) + + - name: release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ steps.version.outputs.version }} + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: upload linux artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./packages/app-mobile/android/app/build/outputs/apk/release/app-release.apk + asset_name: app-release.apk + asset_content_type: application/vnd.android.package-archive