summaryrefslogtreecommitdiff
path: root/.forgejo/workflows/pip.yml
blob: 6f3503851c1c1b37d6354af34ca2e55093cda1de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build Pip Packages

on:
  push:
    branches:
      - '**'
  release:
    types: [published]

jobs:
  build-deb:
    name: Pip build for ${{ matrix.image }} ${{ matrix.arch }}
    strategy:
      matrix:
        # Add aarch64 here for ARM builds
        arch:
          - "x86_64"
    runs-on: codeberg-small-lazy
    container:
      image: quay.io/pypa/manylinux_2_28_${{ matrix.arch }}
    steps:
      - name: Checkout Repository
        run: git clone --depth 1 -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} .

      - name: Install build dependencies
        run: |
          yum install -y golang python3 python3-setuptools python3-wheel wget
          python3 -m pip install build

      - name: Get version
        run: echo "COMMONVERSION=$(grep -o 'const Version = "[^"]*' internal/commonver/commonver.go | cut -d '"' -f 2)" >> "$GITHUB_ENV"

      - name: Build common
        run: CGO_ENABLED=1 go build -buildvcs=false -tags=release -o lib/linux/amd64/libeduvpn_common-$COMMONVERSION.so -buildmode=c-shared ./exports

      - name: Build python
        run: |
          install lib/linux/amd64/libeduvpn_common-$COMMONVERSION.so -Dt wrappers/python/eduvpn_common/lib
          python3 -m build --sdist --wheel wrappers/python