~flozz/yoga-image-optimizer/master

« back to all changes in this revision

Viewing changes to .github/workflows/python-packages.yml

  • Committer: Fabien LOISON
  • Date: 2021-06-12 06:27:41 UTC
  • Revision ID: git-v1:154e3a187b6c25a38302e1d4d5ed8f3f98782e6d
Fix PyPI package build process (closes #4)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
jobs:
8
8
 
9
 
  build_sdist:
 
9
  build_sdist_wheel:
10
10
 
11
 
    name: "Source distribution"
 
11
    name: "Source and wheel distribution"
12
12
    runs-on: ubuntu-latest
13
13
 
14
14
    steps:
18
18
        with:
19
19
          submodules: true
20
20
 
 
21
      - name: "Install build dependencies"
 
22
        run: |
 
23
          sudo apt-get install -y gettext
 
24
 
21
25
      - name: "Set up Python"
22
26
        uses: actions/setup-python@v1
23
27
        with:
24
28
          python-version: 3.9
25
29
 
 
30
      - name: "Install Python build dependencies"
 
31
        run: |
 
32
          pip install wheel nox
 
33
 
 
34
      - name: "Compile locales"
 
35
        run: |
 
36
          nox -s locales_compile
 
37
 
26
38
      - name: "Build source distribution"
27
39
        run: |
28
40
          python setup.py sdist
29
41
 
30
 
      - name: "Upload artifacts"
31
 
        uses: actions/upload-artifact@v2
32
 
        with:
33
 
          name: yoga-image-optimizer-sdist
34
 
          path: dist/
35
 
          retention-days: 1
36
 
 
37
 
  build_wheel_linux:
38
 
 
39
 
    strategy:
40
 
      matrix:
41
 
        python-version: [cp37-cp37m, cp38-cp38, cp39-cp39]
42
 
 
43
 
    name: "Wheel for ${{ matrix.python-version }} manylinux2010"
44
 
    runs-on: ubuntu-latest
45
 
 
46
 
    steps:
47
 
 
48
 
      - name: "Checkout the repository"
49
 
        uses: actions/checkout@v2
50
 
 
51
 
      - name: "Build Python Wheel for Linux (manylinux2010)"
52
 
        uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2010_x86_64
53
 
        with:
54
 
          python-versions: ${{ matrix.python-version }}
55
 
          build-requirements: cffi>=1.0.0
56
 
 
57
 
      - name: "Upload artifacts"
58
 
        uses: actions/upload-artifact@v2
59
 
        with:
60
 
          name: yoga-image-optimizer-wheel-linux
61
 
          path: dist/*manylinux*.whl
62
 
          retention-days: 1
63
 
 
64
 
  build_wheel_windows:
65
 
 
66
 
    strategy:
67
 
      matrix:
68
 
        python-version: [3.7, 3.8, 3.9]
69
 
 
70
 
    name: "Wheel for py${{ matrix.python-version }} win amd64"
71
 
    runs-on: windows-latest
72
 
 
73
 
    steps:
74
 
 
75
 
      - name: "Checkout the repository"
76
 
        uses: actions/checkout@v2
77
 
        with:
78
 
          submodules: true
79
 
 
80
 
      - name: "Set up Python ${{ matrix.python-version }}"
81
 
        uses: actions/setup-python@v1
82
 
        with:
83
 
          python-version: ${{ matrix.python-version }}
84
 
 
85
 
      - name: "Install Python dependencies"
86
 
        run: |
87
 
          pip install wheel
88
 
 
89
 
      - name: "Build Python Wheel"
 
42
      - name: "Build wheel"
90
43
        run: |
91
44
          python setup.py bdist_wheel
92
45
 
93
46
      - name: "Upload artifacts"
94
47
        uses: actions/upload-artifact@v2
95
48
        with:
96
 
          name: yoga-image-optimizer-wheel-windows
 
49
          name: yoga-image-optimizer-dist
97
50
          path: dist/
98
51
          retention-days: 1
99
52
 
102
55
    name: "Publish packages on PyPI"
103
56
    runs-on: ubuntu-latest
104
57
    needs:
105
 
      - build_sdist
106
 
      - build_wheel_linux
107
 
      - build_wheel_windows
 
58
      - build_sdist_wheel
108
59
 
109
60
    steps:
110
61
 
114
65
      - name: "Move packages to the dist/ folder"
115
66
        run: |
116
67
          mkdir dist/
117
 
          mv yoga-image-optimizer-sdist/* dist/
118
 
          mv yoga-image-optimizer-wheel-*/*.whl dist/
 
68
          mv yoga-image-optimizer-dist/* dist/
119
69
 
120
70
      - name: "Publish packages on PyPI"
121
71
        uses: pypa/gh-action-pypi-publish@release/v1