workflow: rules: - if: $NIGHTLY_BUILD - if: $DEBIAN_BUILD - if: $WINDOWS_BUILD - if: $CI_PIPELINE_SOURCE == "push" stages: - test - build - deploy - publish test-other: image: gajim-test stage: test script: - pyproject-build - python ./pep517build/build_metadata.py - appstream-util validate dist/metadata/org.gajim.Gajim.appdata.xml interruptible: true test-codespell: image: gajim-test stage: test script: - codespell --version - codespell gajim interruptible: true test-pyright: image: gajim-test stage: test rules: - changes: - "**/*.py" script: - pip install git+https://dev.gajim.org/gajim/python-nbxmpp.git - pip install git+https://dev.gajim.org/gajim/omemo-dr.git - pip install --config-settings=config=Gtk3,Gdk3,GtkSource4 git+https://github.com/pygobject/pygobject-stubs.git - pyright --version - pyright interruptible: true test-ruff: image: gajim-test stage: test rules: - changes: - "**/*.py" script: - ruff --version - ruff . interruptible: true test-isort: image: gajim-test stage: test rules: - changes: - "**/*.py" script: - isort --version - isort --check . interruptible: true test-unittest: image: gajim-test stage: test script: - pip install git+https://dev.gajim.org/gajim/python-nbxmpp.git - coverage run --source=gajim -m unittest discover -s test -v - coverage report -mi - coverage xml -i coverage: "/TOTAL.+ ([0-9]{1,3}%)/" artifacts: reports: coverage_report: coverage_format: cobertura path: coverage.xml interruptible: true build-unix: image: gajim-build stage: build dependencies: [] rules: - if: '$DEBIAN_BUILD' - if: '$NIGHTLY_BUILD' - if: '$CI_COMMIT_TAG' script: - pyproject-build artifacts: name: "gajim-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA" expire_in: 1 week paths: - dist/gajim-*.tar.gz - dist/gajim-*.whl build-debian-nightly: image: gajim-build stage: build variables: REV: "1" needs: - job: build-unix artifacts: true rules: - if: '$DEBIAN_BUILD' - if: '$NIGHTLY_BUILD' script: - apt-get update - apt-get install -y python3-nbxmpp-nightly - apt-get install -y python3-omemo-dr - release-helper build-debian-pkg "$(find dist/gajim-*.tar.gz)" $REV --pkgsuffix=nightly artifacts: name: "gajim-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA" expire_in: 1 week paths: - debian_build/* build-windows: image: gajim-build stage: build dependencies: [] rules: - if: '$CI_COMMIT_TAG' script: - > release-helper build-windows-pkg \ --account=lovetox \ --repository=https://dev.gajim.org/gajim/gajim \ --branch=master \ --version=$CI_COMMIT_TAG \ --commit-sha=$CI_COMMIT_SHA \ --api-key=$APPVEYOR_API_KEY \ .ci/appveyor.yml artifacts: expire_in: 1 day paths: - windows_build/*.json build-windows-nightly: image: gajim-build stage: build dependencies: [] rules: - if: '$NIGHTLY_BUILD' - if: '$WINDOWS_BUILD' script: - > release-helper build-windows-pkg \ --account=lovetox \ --repository=https://dev.gajim.org/gajim/gajim \ --branch=master \ --version=Nightly \ --commit-sha=$CI_COMMIT_SHA \ --api-key=$APPVEYOR_API_KEY \ .ci/appveyor.yml artifacts: expire_in: 1 day paths: - windows_build/*.json deploy-unix: image: gajim-deploy stage: deploy dependencies: - build-unix rules: - if: '$CI_COMMIT_TAG' script: - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=downloads/"$(echo $CI_COMMIT_TAG | cut -c 1-3)" \ --rename=gajim-$CI_COMMIT_TAG.tar.gz \ "$(find dist/gajim-*.tar.gz)" deploy-unix-nightly: image: gajim-deploy stage: deploy dependencies: - build-unix needs: - build-unix rules: - if: '$NIGHTLY_BUILD' allow_failure: exit_codes: - 100 script: - release-helper nightly-check - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=downloads/snap \ --rename=gajim-"$(date +'%Y-%m-%d')".tar.gz \ "$(find dist/gajim-*.tar.gz)" deploy-debian-nightly: image: gajim-deploy stage: deploy dependencies: - build-debian-nightly needs: - build-debian-nightly rules: - if: '$DEBIAN_BUILD' - if: '$NIGHTLY_BUILD' allow_failure: exit_codes: - 100 script: - release-helper nightly-check - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=debian/gajim/"$(date +'%Y%m%d')" \ debian_build deploy-windows: image: gajim-deploy stage: deploy dependencies: - build-windows rules: - if: '$CI_COMMIT_TAG' script: - release-helper download-appveyor-artifacts "$(find windows_build/*.json)" windows_build - rm windows_build/*.json - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=downloads/"$(echo $CI_COMMIT_TAG | cut -c 1-3)" \ windows_build deploy-windows-nightly: image: gajim-deploy stage: deploy dependencies: - build-windows-nightly needs: - build-windows-nightly rules: - if: '$NIGHTLY_BUILD' - if: '$WINDOWS_BUILD' allow_failure: exit_codes: - 100 script: - release-helper nightly-check - release-helper download-appveyor-artifacts "$(find windows_build/*.json)" windows_build - rm windows_build/*.json - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ --user=$FTP_USER \ --password=$FTP_PASS \ --directory=downloads/snap/win \ windows_build deploy-flatpak: image: gajim-deploy stage: deploy dependencies: [] rules: - if: '$CI_COMMIT_TAG' before_script: - eval $(ssh-agent -s) - .ci/prepare_git.sh github.com "${FLATHUB_DEPLOY_KEY}" script: # extract the current commit hash of the shared-modules submodule - submodule_commit=$(git submodule status flatpak/shared-modules | cut -c 2-41) - git clone git@github.com:flathub/org.gajim.Gajim.git - cd org.gajim.Gajim - mv ../flatpak/org.gajim.Gajim.yaml org.gajim.Gajim.yaml - mv ../flatpak/app-overrides.json app-overrides.json # point the shared-modules submodule to the new commit, without fetching the repository - git update-index --cacheinfo 160000,${submodule_commit},shared-modules - git diff - git add --all - git commit -m "$CI_COMMIT_TAG" - git push publish-website: image: gajim-publish stage: publish dependencies: [] rules: - if: '$CI_COMMIT_TAG' before_script: - eval $(ssh-agent -s) - .ci/prepare_git.sh dev.gajim.org "${WEBSITE_DEPLOY_KEY}" script: - git clone git@dev.gajim.org:gajim/website.git - cd website - git checkout master - python ./scripts/bump_version.py $CI_COMMIT_TAG - git diff - git add -u - git commit -m "Release Gajim $CI_COMMIT_TAG" - git push publish-release: image: gajim-publish stage: publish dependencies: [] rules: - if: '$CI_COMMIT_TAG' script: - > release-helper finish-milestone \ $CI_PROJECT_ID \ $PROJECT_TOKEN \ --version=$CI_COMMIT_TAG \ --title="Next Release" - > release-helper create-release \ $CI_PROJECT_ID \ $PROJECT_TOKEN \ --version=$CI_COMMIT_TAG \ --tag=$CI_COMMIT_TAG \ --milestone=$CI_COMMIT_TAG