name: nightly-neon

on:
  schedule:
    - cron: "52 23 * * *"
  workflow_dispatch:

env:
  BUILDDIR: /build
  SRCDIR: ${{ github.workspace }}
  CMAKE_ARGS: |
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
    -DCMAKE_BUILD_TYPE=Debug

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: docker://kdeneon/plasma:user
      options: --tmpfs /build:rw --user 0:0
    steps:
      - name: "prepare source"
        uses: calamares/actions/generic-checkout@v5
      - name: "install dependencies"
        shell: bash
        run: ./ci/deps-neon.sh
      - name: "build"
        shell: bash
        run: ./ci/build.sh
      - name: "Calamares: archive"
        working-directory: ${{ env.BUILDDIR }}
        run: |
          DESTDIR=${{ env.BUILDDIR }}/stage ninja install
          tar czf calamares.tar.gz stage
      - name: "Calamares: upload"
        uses: actions/upload-artifact@v3
        with:
          name: calamares-tarball
          path: ${{ env.BUILDDIR }}/calamares.tar.gz
          if-no-files-found: error
          retention-days: 7