From 2642fb6ef8ced7fd670701266f42ade3f4971d71 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Fri, 20 Oct 2023 21:44:59 +0900 Subject: [PATCH] Actions: Unify coding style (#120) --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++ .github/workflows/gettext.yml | 33 ++++++++++++++++++++++ .github/workflows/main.yml | 36 ------------------------ 3 files changed, 86 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/gettext.yml delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9b416bb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: [pull_request] + +jobs: + flatpak: + name: Flatpak + runs-on: ubuntu-22.04 + + strategy: + matrix: + arch: [x86_64, aarch64] + # Don't fail the whole workflow if one architecture fails + fail-fast: false + + container: + image: ghcr.io/elementary/flatpak-platform/runtime:7.2-${{ matrix.arch }} + options: --privileged + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU for aarch64 emulation + if: ${{ matrix.arch != 'x86_64' }} + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Build + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: spreadsheet.flatpak + manifest-path: com.github.elework.spreadsheet.yml + 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-22.04 + + container: + image: valalang/lint + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint + run: io.elementary.vala-lint -d . diff --git a/.github/workflows/gettext.yml b/.github/workflows/gettext.yml new file mode 100644 index 0000000..c6d8fe1 --- /dev/null +++ b/.github/workflows/gettext.yml @@ -0,0 +1,33 @@ +name: Gettext updates + +on: + push: + branches: [main] + +jobs: + gettext_flatpak: + name: Gettext Flatpak + runs-on: ubuntu-latest + + container: + image: ghcr.io/elementary/flatpak-platform/runtime:7.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" + + - uses: elementary/actions/gettext-flatpak@main + with: + manifest-path: 'com.github.elework.spreadsheet.yml' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 7ba6936..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: CI - -on: [pull_request] - -jobs: - deploy_flatpak: - name: Deploy Flatpak - runs-on: ubuntu-latest - - container: - image: ghcr.io/elementary/flatpak-platform/runtime:7 - options: --privileged - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Build - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 - with: - bundle: spreadsheet.flatpak - manifest-path: com.github.elework.spreadsheet.yml - run-tests: true - repository-name: appcenter - repository-url: https://flatpak.elementary.io/repo.flatpakrepo - cache-key: "flatpak-builder-${{ github.sha }}" - - lint: - name: Lint - runs-on: ubuntu-latest - container: - image: valalang/lint - steps: - - uses: actions/checkout@v3 - - name: Lint - run: io.elementary.vala-lint -d .