build_variants.yml 3.33 KB
Newer Older
1
name: Python libs
Simon Ward's avatar
Simon Ward committed
2
3
4

on:
  push:
5
6
7
8
9
10
    branches: [ master ]
  pull_request:
    branches: [ master ]
#  schedule:
#    # Every day at 1am
#    - cron: '0 1 * * *'
Simon Ward's avatar
Simon Ward committed
11
12

jobs:
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

  get_Latest:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[ci skip]')"

    steps:
    - name: Checkout ILL repo
      run: |
        git clone https://code.ill.fr/scientific-software/crysfml/ ./
        git checkout feature-python_api-build_wheels
        rm -rf ./.git ./Html
    - uses: actions/upload-artifact@v2
      with:
        name: CrysFML_SRC
        path: ${{ github.workspace }}
        retention-days: 1


  create-Linux:
    runs-on: ubuntu-latest

    needs: get_Latest

    steps:
    - uses: actions/download-artifact@v2
      with:
        name: CrysFML_SRC

    - name: Build manylinux wheels
      run:  |
        chmod +x ./Scripts/buildscript.sh
        docker run -e PLAT=manylinux2010_x86_64 -v ${{ github.workspace }}:/io quay.io/pypa/manylinux2010_x86_64 /io/Scripts/buildscript.sh
    - uses: actions/upload-artifact@v2
      with:
        name: CrysFML - Linux
        path: ${{ github.workspace }}/dist/*.whl

  create-OSX:
    strategy:
      max-parallel: 4
      matrix:
        python-version: ['3.8']
        os: [macos-10.15]
        gcc_v: [ 10 ] # Version of GFortran we want to use.

    runs-on: ${{ matrix.os }}

    needs: get_Latest

    steps:
    - uses: actions/download-artifact@v2
      with:
        name: CrysFML_SRC

    - name: Setup python
      uses: actions/setup-python@v1
      with:
        python-version: ${{matrix.python-version}}

    - name: Install cmake
      run: pip3 install cmake delocate wheel

    - name: Build CFML (OSX)
      env:
        FC: gfortran-${{ matrix.gcc_v }}
        CC: gcc-${{ matrix.gcc_v }}
      run: |
        pip3 wheel ./ --no-deps -w ./old/
        delocate-wheel -w dist -v ./old/*.whl
    - uses: actions/upload-artifact@v2
      with:
        name: CrysFML - MacOS
        path: ./dist/*.whl
Simon Ward's avatar
Simon Ward committed
86

Simon Ward's avatar
Simon Ward committed
87
  create-Windows:
Simon Ward's avatar
Simon Ward committed
88
    strategy:
Simon Ward's avatar
Simon Ward committed
89
      max-parallel: 1
Simon Ward's avatar
Simon Ward committed
90
      matrix:
Simon Ward's avatar
Simon Ward committed
91
        python-version: [ '3.6', '3.7']
Simon Ward's avatar
Simon Ward committed
92
        os: [ windows-latest ]
Simon Ward's avatar
Simon Ward committed
93
94
95

    runs-on: ${{ matrix.os }}
    steps:
Simon Ward's avatar
Simon Ward committed
96
      - uses: actions/checkout@v2
Simon Ward's avatar
Simon Ward committed
97

Simon Ward's avatar
Simon Ward committed
98
      - uses: conda-incubator/setup-miniconda@v2
Simon Ward's avatar
Simon Ward committed
99
        with:
Simon Ward's avatar
Simon Ward committed
100
101
102
          auto-update-conda: true
          python-version: ${{ matrix.python-version }}
          auto-activate-base: true
Simon Ward's avatar
Simon Ward committed
103
104
105
106
107
108
109
110
111
112
113

      - uses: msys2/setup-msys2@v2
        with:
          msystem: MSYS
          install: cmake mingw-w64-x86_64-toolchain
          update: true
          path-type: inherit

      - name: Build CFML
        shell: msys2 {0}
        id: build
Simon Ward's avatar
Simon Ward committed
114
        run: python setup.py bdist_wheel
Simon Ward's avatar
Simon Ward committed
115
116
117
        env:
          MINGW_ARCH: MINGW64

Simon Ward's avatar
Simon Ward committed
118
119
      - uses: actions/upload-artifact@v2
        with:
120
          name: CrysFML - Windows
Simon Ward's avatar
Simon Ward committed
121
          path: ./dist/*.whl
Simon Ward's avatar
Simon Ward committed
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  Upload_Artifacts:
    runs-on: ubuntu-latest
    needs: [create-Linux, create-OSX]
    steps:
    - uses: actions/download-artifact@v2
    - name: What is downloaded
      run: |
        ls -al
    - name: Upload Artifacts GitHub releases
      uses: ncipollo/release-action@v1
      with:
        draft: false
        prerelease: true
        allowUpdates: true
        replacesArtifacts: true
        token: ${{ secrets.GITHUB_TOKEN }}
        artifacts: "./**/*.whl"
        tag: "CurrentBuild"
        body: "This is a build of the CFML libraries."