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

Build Tribler by using GitHub Actions #6903

Merged
merged 1 commit into from
May 30, 2022
Merged

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented May 17, 2022

This PR adds the build.yml workflow for ubuntu that runs on each PR.

Also, it performs the first step of update_version_from_git.py refactoring: extracting update_version.py and update_metadata.py.

When I add a build workflow for each OS, update_version_from_git.py could be deleted.

This change is backwards-compatible with Jenkins one-click-release, but we must add the following lines to Jenkins before the call makedist_debian.sh:

          git describe | python -c 'import sys; print(next(sys.stdin).lstrip("v"))' > .TriblerVersion
          git rev-parse HEAD > .TriblerCommit

@drew2a drew2a force-pushed the feature/ga_build branch 7 times, most recently from 26789c9 to 8124ebc Compare May 23, 2022 14:55
@drew2a
Copy link
Contributor Author

drew2a commented May 24, 2022

For the history (manual approve for upload):

name: Binaries

on:
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        python-version: [ '3.8' ]
        os: [ ubuntu-22.04 ]

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
          ref: ${{github.event.pull_request.head.sha}}

      - name: Cache package
        id: cache
        uses: actions/cache@v3
        with:
          path: cache
          key: ubuntu-cache

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install Pip dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r ./requirements-build.txt

      - name: Install Ubuntu dependencies
        run: |
          sudo apt-get update
          sudo apt-get -y install debhelper devscripts
          # for qt:
          sudo apt-get -y install libxcb-xinerama0-dev libqt5x11extras5

      - name: Save Git info
        run: |
          git describe --tags HEAD > .TriblerVersion
          echo ${{ github.event.pull_request.head.ref }} > .TriblerBranch
          echo ${{ github.event.pull_request.head.sha }} > .TriblerCommit

      - name: Run build script
        timeout-minutes: 5
        env:
          SENTRY_URL: ${{secrets.SENTRY_URL}}
          QT_QPA_PLATFORM: offscreen
          QT_ACCESSIBILITY: 1
          QT_IM_MODULE: ibus
        run: |
          ./build/debian/makedist_debian.sh

      - name: Move binaries to cache
        run: |
          mkdir -p cache
          mv tribler.deb ./cache


  upload:
    runs-on: ubuntu-latest
    needs: [ build ]
    environment:
      name: Upload
    steps:
      - name: Cache package
        id: cache
        uses: actions/cache@v3
        with:
          key: ubuntu-cache
          path: cache

      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: tribler.deb
          path: cache/tribler.deb
          retention-days: 1

image

image

image

@drew2a drew2a marked this pull request as ready for review May 25, 2022 09:17
@drew2a drew2a requested review from a team and xoriole and removed request for a team May 25, 2022 09:17
@drew2a drew2a marked this pull request as draft May 25, 2022 09:30
@drew2a drew2a marked this pull request as ready for review May 25, 2022 10:32
@drew2a drew2a marked this pull request as draft May 25, 2022 10:32
@drew2a drew2a marked this pull request as ready for review May 25, 2022 10:34
@drew2a drew2a force-pushed the feature/ga_build branch 3 times, most recently from 2d71ec6 to 24c0284 Compare May 25, 2022 10:48
Copy link
Contributor

@xoriole xoriole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements 👍

A concern is how it affects the Flatpak build and push to Flathub, that needs to be checked before merging.
https://flathub.org/apps/details/org.tribler.Tribler

build/debian/tribler/debian/changelog Outdated Show resolved Hide resolved
@xoriole
Copy link
Contributor

xoriole commented May 25, 2022

          git describe | python -c 'import sys; print(next(sys.stdin).lstrip("v"))' > .TriblerVersion
          git rev-parse HEAD > .TriblerCommit

These commands are added to Ubuntu .deb builder on Jenkins
https://jenkins-ci.tribler.org/job/Build-Tribler_release/job/Build-Ubuntu64/

@drew2a drew2a requested a review from xoriole May 25, 2022 11:50
@drew2a
Copy link
Contributor Author

drew2a commented May 25, 2022

@xoriole I don't see any mentions of Flatpak in our repo.

Could you please give me a link to the Flatpak build?

@xoriole
Copy link
Contributor

xoriole commented May 25, 2022

@xoriole I don't see any mentions of Flatpak in our repo.

Could you please give me a link to the Flatpak build?

Flatpak build is community contributed and is present here:
https://github.com/flathub/org.tribler.Tribler

Revisiting the config file, the Flatpak package is built using Debian package from the GitHub release URL. Therefore, this PR would not have any effect on that. So, my original concern regarding Flatpak build is invalid.

@drew2a drew2a merged commit d094941 into Tribler:main May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants