diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8cdc305 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: [pull_request] + +jobs: + flatpak: + name: Flatpak + runs-on: ${{ matrix.runs-on }} + + strategy: + matrix: + include: + - arch: x86_64 + runs-on: ubuntu-latest + - arch: aarch64 + runs-on: ubuntu-24.04-arm + # Don't fail the whole workflow if one architecture fails + fail-fast: false + + container: + image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.arch }} + options: --privileged + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: contacts.flatpak + manifest-path: io.elementary.contacts.json + run-tests: true + repository-name: appcenter + repository-url: https://flatpak.elementary.io/repo.flatpakrepo + cache-key: "flatpak-builder-${{ github.sha }}" + arch: ${{ matrix.arch }} + + lint: + name: Lint + runs-on: ubuntu-latest + + container: + image: valalang/lint + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint + run: io.elementary.vala-lint -d . diff --git a/.github/workflows/flatpak-x-checker.yml b/.github/workflows/flatpak-x-checker.yml new file mode 100644 index 0000000..55b17ab --- /dev/null +++ b/.github/workflows/flatpak-x-checker.yml @@ -0,0 +1,22 @@ +name: Check for updates +on: + schedule: # for scheduling to work this file must be in the default branch + - cron: "0 0 * * 1" # run weekly + workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab + +jobs: + flatpak-external-data-checker: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest + env: + GIT_AUTHOR_NAME: elementaryBot + GIT_COMMITTER_NAME: elementaryBot + GIT_AUTHOR_EMAIL: builds@elementary.io + GIT_COMMITTER_EMAIL: builds@elementary.io + EMAIL: builds@elementary.io + GITHUB_TOKEN: ${{ secrets.GIT_USER_TOKEN }} + with: + args: --update --never-fork io.elementary.contacts.json diff --git a/.github/workflows/gettext.yml b/.github/workflows/gettext.yml deleted file mode 100644 index f467206..0000000 --- a/.github/workflows/gettext.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Gettext Updates -on: - push: - branches: [master] -jobs: - gettext_template: - runs-on: ubuntu-latest - - steps: - - name: Clone repository - uses: actions/checkout@v4 - with: - token: ${{ secrets.GIT_USER_TOKEN }} - - - name: Update Translation Files - uses: elementary/actions/gettext-template@next - env: - GIT_USER_TOKEN: ${{ secrets.GIT_USER_TOKEN }} - GIT_USER_NAME: "elementaryBot" - GIT_USER_EMAIL: "builds@elementary.io" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 39a627c..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: CI - -on: - pull_request: - types: - - opened - - reopened - - synchronize - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - version: [stable, unstable, development-target] - container: - image: ghcr.io/elementary/docker:${{ matrix.version }} - - steps: - - uses: actions/checkout@v4 - - name: Install Dependencies - run: | - apt update - apt install -y libfolks-dev libgranite-7-dev libadwaita-1-dev - - name: Build - env: - DESTDIR: out - run: | - meson build - ninja -C build - ninja -C build install - - lint: - - runs-on: ubuntu-latest - - container: - image: valalang/lint - - steps: - - uses: actions/checkout@v4 - - name: Lint - run: io.elementary.vala-lint -d . diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..d9b6528 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,77 @@ +name: Merge + +on: + push: + branches: + - main + +jobs: + deploy_flatpak: + name: Deploy Flatpak (${{ matrix.configuration.arch }}) + runs-on: ${{ matrix.configuration.runs-on }} + + strategy: + matrix: + configuration: + - arch: x86_64 + runs-on: ubuntu-latest + - arch: aarch64 + runs-on: ubuntu-24.04-arm + # Don't fail the whole workflow if one architecture fails + fail-fast: false + + container: + image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.configuration.arch }} + options: --privileged + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + uses: flatpak/flatpak-github-actions/flatpak-builder@v6.5 + with: + bundle: contacts.flatpak + manifest-path: io.elementary.contacts.json + repository-name: appcenter + repository-url: https://flatpak.elementary.io/repo.flatpakrepo + cache-key: "flatpak-builder-${{ github.sha }}" + branch: daily + arch: ${{ matrix.configuration.arch }} + + - name: Deploy + uses: flatpak/flatpak-github-actions/flat-manager@v6.5 + with: + repository: appcenter + flat-manager-url: https://flatpak-api.elementary.io + token: ${{ secrets.FLAT_MANAGER_TOKEN }} + + gettext: + name: Gettext + runs-on: ubuntu-latest + container: + image: ghcr.io/elementary/flatpak-platform/runtime:8.2-x86_64 + options: --privileged + + steps: + - name: Install git, python3-git and jq + run: | + apt-get update + apt-get install git jq python3-git -y + + - name: Clone repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GIT_USER_TOKEN }} + + - name: Configure Git + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Update Translation Files + uses: elementary/actions/gettext-flatpak@main + with: + manifest-path: 'io.elementary.contacts.json' + env: + GIT_USER_NAME: "elementaryBot" + GIT_USER_EMAIL: "builds@elementary.io" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3c3ce45 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,69 @@ +name: Release + +on: + pull_request: + branches: [main] + types: [closed] + +jobs: + create_release: + name: Create Release + runs-on: ubuntu-latest + + if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release') + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Release + uses: elementary/actions/release@main + env: + GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}" + GIT_USER_NAME: "elementaryBot" + GIT_USER_EMAIL: "builds@elementary.io" + with: + release_branch: 'noble' + + deploy_flatpak: + name: Deploy Flatpak (${{ matrix.configuration.arch }}) + runs-on: ${{ matrix.configuration.runs-on }} + + if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release') + + strategy: + matrix: + configuration: + - arch: x86_64 + runs-on: ubuntu-latest + - arch: aarch64 + runs-on: ubuntu-24.04-arm + # Don't fail the whole workflow if one architecture fails + fail-fast: false + + container: + image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.configuration.arch }} + options: --privileged + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + uses: flatpak/flatpak-github-actions/flatpak-builder@v6.5 + with: + bundle: contacts.flatpak + manifest-path: io.elementary.contacts.json + run-tests: true + repository-name: appcenter + repository-url: https://flatpak.elementary.io/repo.flatpakrepo + cache-key: "flatpak-builder-${{ github.sha }}" + branch: stable + arch: ${{ matrix.configuration.arch }} + + - name: Deploy + uses: flatpak/flatpak-github-actions/flat-manager@v6.5 + with: + repository: appcenter + flat-manager-url: https://flatpak-api.elementary.io + token: ${{ secrets.FLAT_MANAGER_TOKEN }} diff --git a/data/contacts.metainfo.xml.in b/data/contacts.metainfo.xml.in index 56b3df7..c6f0042 100644 --- a/data/contacts.metainfo.xml.in +++ b/data/contacts.metainfo.xml.in @@ -15,7 +15,7 @@ - https://raw.githubusercontent.com/elementary/contacts/master/data/screenshot.png + https://raw.githubusercontent.com/elementary/contacts/main/data/screenshot.png diff --git a/io.elementary.contacts.json b/io.elementary.contacts.json new file mode 100644 index 0000000..30917fb --- /dev/null +++ b/io.elementary.contacts.json @@ -0,0 +1,141 @@ +{ + "id": "io.elementary.contacts", + "runtime": "io.elementary.Platform", + "runtime-version": "8.2", + "sdk": "io.elementary.Sdk", + "command": "io.elementary.contacts", + "finish-args": [ + "--share=ipc", + "--share=network", + "--socket=fallback-x11", + "--socket=wayland", + "--talk-name=org.gnome.evolution.dataserver.AddressBook10", + "--talk-name=org.gnome.evolution.dataserver.Sources5", + "--metadata=X-DConf=migrate-path=/io/elementary/contacts/" + ], + "cleanup": [ + "/include", + "/lib/pkgconfig", + "/share/vala", + "*.a", + "*.la" + ], + "modules": [ + { + "name": "evolution-data-server", + "buildsystem": "cmake-ninja", + "cleanup": [ + "/etc", + "/lib/evolution-data-server/*-backends", + "/libexec", + "/share/dbus-1", + "/share/GConf", + "/share/pixmaps" + ], + "config-opts": [ + "-DCMAKE_BUILD_TYPE=RelWithDebInfo", + "-DENABLE_EXAMPLES=OFF", + "-DENABLE_TESTS=OFF", + "-DENABLE_GOA=OFF", + "-DWITH_LIBDB=OFF", + "-DENABLE_WEATHER=OFF", + "-DENABLE_CANBERRA=OFF", + "-DENABLE_VALA_BINDINGS=ON", + "-DWITH_KRB5=OFF", + "-DWITH_OPENLDAP=OFF", + "-DENABLE_INTROSPECTION=ON" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/evolution-data-server.git", + "tag": "3.56.2", + "x-checker-data": { + "type": "git", + "tag-pattern": "^([\\d.]+)$", + "versions": { + "<": "3.57" + } + } + } + ], + "modules": [ + { + "name": "intltool", + "cleanup": [ + "*" + ], + "sources": [ + { + "type": "archive", + "url": "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz", + "md5": "12e517cac2b57a0121cda351570f1e63" + } + ] + }, + { + "name": "libical", + "cleanup": [ + "/lib/cmake", + "/libexec" + ], + "buildsystem": "cmake-ninja", + "config-opts": [ + "-DCMAKE_BUILD_TYPE=RelWithDebInfo", + "-DCMAKE_INSTALL_LIBDIR=/app/lib", + "-DWITH_CXX_BINDINGS=false", + "-DSHARED_ONLY=true", + "-DGOBJECT_INTROSPECTION=true", + "-DICAL_BUILD_DOCS=false", + "-DICAL_GLIB_VAPI=true", + "-DLIBICAL_BUILD_TESTING=false" + ], + "sources": [ + { + "type": "git", + "url": "https://github.com/libical/libical.git", + "tag": "v3.0.20", + "x-checker-data": { + "type": "git", + "tag-pattern": "^v([\\d.]+)$" + } + } + ] + } + ] + }, + { + "name": "folks", + "buildsystem": "meson", + "config-opts": [ + "-Dbluez_backend=false", + "-Dofono_backend=false", + "-Dtelepathy_backend=false", + "-Dimport_tool=false", + "-Dinspect_tool=false", + "-Dlibdir=/app/lib" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/folks.git", + "tag": "0.15.9", + "x-checker-data": { + "type": "git", + "tag-pattern": "^([\\d.]+)$" + } + } + ] + }, + { + "name": "contacts", + "buildsystem": "meson", + "sources": [ + { + "type": "dir", + "path": "." + } + ] + } + ] +}