Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of a GitHub action to build the debian package after changes in this repository #119

Open
jredrejo opened this issue Apr 19, 2023 · 1 comment
Assignees

Comments

@jredrejo
Copy link
Member

In order to test changes in the repository, whenever a push is done we should trigger a package build.
To do it, we first need to recover a kolibri tar file, leave it in the build_src directory of this repository and call the kolibri.deb target from this repostory Makefile

This is a possible yaml file that's not working yet because the step of fetching a tar kolibri file has to be correctly implemented:


name: Test creation of deb package after code changes

on:
  push:
    branches:
    - develop
    - 'release-v**'
  pull_request:
    branches:
    - develop
    - 'release-v**'
  workflow_dispatch:

  workflow_call:
    outputs:
        deb-file-name:
          description: "DEB file name"
          value: ${{ jobs.build_deb.outputs.deb-file-name }}

jobs:
  build_deb:
    name: Build DEB file
    runs-on: ubuntu-latest
    outputs:
      deb-file-name: ${{ steps.get-deb-filename.outputs.deb-file-name }}
    steps:
    - uses: actions/checkout@v3
      with:
        repository: learningequality/kolibri-installer-debian
    - uses: actions/cache@v3
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'build_requires.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: 3.10.11
    - name: Download artifact from kolibri repository
      uses: dawidd6/action-download-artifact@v2
      with:
        workflow: pr_build_kolibri.yml
        branch: master
        repo: learningequality/kolibri/
        path: build_src
    - name: Install Debian build package dependencies
      run: sudo apt install -y devscripts debhelper dh-python python3-all python3-pytest po-debconf python3-setuptools
    - name: Run the build
      run: make kolibri.deb
    - name: Get DEB filename
      id: get-deb-filename
      run: echo "::set-output name=deb-file-name::$(ls dist | grep all.deb | cat)"
    - uses: actions/upload-artifact@v2
      with:
        name: ${{ steps.get-deb-filename.outputs.deb-file-name }}
        path: dist/${{ steps.get-deb-filename.outputs.deb-file-name }}
@jredrejo jredrejo self-assigned this Apr 19, 2023
@rtibbles
Copy link
Member

I would suggest copying the version I implemented here: https://github.com/learningequality/kolibri-installer-android/blob/develop/.github/workflows/pr_build.yml (and reuse the reusable debian build workflow in this repository).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants