File: release.yml

package info (click to toggle)
refnx 0.1.61-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,996 kB
  • sloc: python: 37,162; cpp: 1,015; ansic: 185; makefile: 181; sh: 131; lisp: 89; xml: 34
file content (166 lines) | stat: -rw-r--r-- 5,001 bytes parent folder | download
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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# This action releases refnx on PyPI for every version tagged commit (e.g. v0.0.1)
name: PyPI/Github Release

on:
  push:
    tags:
      - "v*"

jobs:
  build_wheels:
    runs-on: ${{ matrix.os }}
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
    strategy:
      matrix:
        os: [windows-latest, macos-14]

    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

      - name: build wheels
        uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
        env:
          CIBW_TEST_COMMAND: pytest --pyargs refnx.reflect.tests.test_reflect
          CIBW_ARCHS_MACOS: "x86_64 arm64"
          CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="10.13"

      - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
        with:
          name: wheels-${{ matrix.os }}
          path: ./wheelhouse/*.whl


  build_linux_x86_64_wheels:
    runs-on: ${{ matrix.os }}
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
    strategy:
      matrix:
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

      - name: build wheels
        uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
        env:
          CIBW_TEST_COMMAND: pytest --pyargs refnx.reflect.tests.test_reflect
          CIBW_BUILD: "*-manylinux_x86_64"

      - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
        with:
          name: wheels-manylinux
          path: ./wheelhouse/*.whl


  build_linux_musl_wheels:
    runs-on: ${{ matrix.os }}
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
    strategy:
      matrix:
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

      - name: build wheels
        uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
        env:
          CIBW_TEST_COMMAND: pytest --pyargs refnx.reflect.tests.test_reflect
          CIBW_BUILD: "*-musllinux_x86_64"

      - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
        with:
          name: wheels-musllinux
          path: ./wheelhouse/*.whl


  make_sdist:
    name: Make sdist
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

    - name: Build sdist
      run: pipx run build --sdist

    - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
      with:
        name: wheels-sdist
        path: dist/*.tar.gz


  check-version:
    runs-on: ubuntu-latest
    needs: [build_linux_musl_wheels, build_linux_x86_64_wheels, build_wheels, make_sdist]

    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

    - name: Set up Python
      uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
      with:
        python-version: 3.11
    - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
      with:
        pattern: wheels-*
        merge-multiple: true
        path: dist
    - name: Check version
      run: |
        python -m pip install numpy scipy orsopy
        ls dist
        python -m pip install --only-binary=refnx --no-index --find-links=dist refnx
        cd dist
        RNX_VERSION="$(python -c "import refnx;print(refnx.version.release)")"
        cd ..
        if  [ $RNX_VERSION == "True" ]; then
          echo "It's a release version of refnx"
          else
            echo "This is not a release version of refnx"
            exit 1
        fi


  pypi-publish:
    name: Upload release to PyPI
    runs-on: ubuntu-latest
    needs: [check-version]
    environment:
      name: pypi
      url: https://pypi.org/p/refnx
    permissions:
      id-token: write  # IMPORTANT: this permission is mandatory for trusted publishing

    steps:
    - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
      with:
        pattern: wheels-*
        merge-multiple: true
        path: dist

    - name: Upload to PyPI
      uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
      with:
        # repository-url: https://test.pypi.org/legacy/
        skip_existing: true


  release-github:
    runs-on: ubuntu-latest
    needs: [ pypi-publish ]

    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

    - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
      with:
        pattern: wheels-*
        merge-multiple: true
        path: dist

    - uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
      with:
        artifacts: "dist/refnx*.tar.gz"
        token: ${{ secrets.GITHUB_TOKEN }}
        allowUpdates: true
        generateReleaseNotes: true