|
4 | 4 | release: |
5 | 5 | types: [created] |
6 | 6 |
|
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
7 | 10 | jobs: |
8 | 11 | build: |
9 | 12 | name: Build wheels on ${{ matrix.os }} |
10 | 13 | runs-on: ${{ matrix.os }} |
11 | 14 | strategy: |
| 15 | + fail-fast: false |
12 | 16 | matrix: |
13 | | - os: [ubuntu-latest, windows-latest, macOS-latest] |
| 17 | + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] |
14 | 18 |
|
15 | 19 | steps: |
16 | | - - uses: actions/checkout@v5.0.0 |
17 | | - |
18 | | - - uses: actions/setup-python@v5.6.0 |
19 | | - name: Install Python |
20 | | - |
21 | | - - name: Install cibuildwheel |
22 | | - run: python -m pip install cibuildwheel==4.2.1 |
23 | | - |
24 | | - - name: Get submodules |
25 | | - run: git submodule update --init --recursive |
| 20 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 21 | + with: |
| 22 | + submodules: recursive |
| 23 | + persist-credentials: false |
26 | 24 |
|
27 | | - - name: Build wheels for Windows |
28 | | - if: startsWith(matrix.os, 'windows') |
29 | | - run: | |
30 | | - python -m cibuildwheel --output-dir wheels |
31 | | - env: |
32 | | - CIBW_SKIP: "cp27-* pp27-*" # skip Python 2.7 wheels |
33 | | - CIBW_ENABLE: "pypy pypy-eol" |
34 | | - |
35 | | - - name: Build wheels for mac and manylinux |
36 | | - if: "!startsWith(matrix.os, 'windows')" |
37 | | - run: | |
38 | | - python -m cibuildwheel --output-dir wheels |
39 | | - env: |
40 | | - CIBW_ARCHS_MACOS: "auto auto32 x86_64 universal2 arm64" |
41 | | - CIBW_ENABLE: "pypy pypy-eol" |
| 25 | + - name: Build wheels |
| 26 | + uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 |
42 | 27 |
|
43 | | - - uses: actions/upload-artifact@v4.6.2 |
44 | | - name: Upload wheels |
| 28 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
45 | 29 | with: |
46 | | - name: wheels |
47 | | - path: ./wheels/*.whl |
| 30 | + name: wheels-${{ matrix.os }} |
| 31 | + path: ./wheelhouse/*.whl |
| 32 | + if-no-files-found: error |
48 | 33 |
|
49 | 34 | publish: |
50 | | - needs: build |
51 | | - name: Publish to PyPI |
52 | | - runs-on: ubuntu-latest |
| 35 | + needs: build |
| 36 | + name: Publish to PyPI |
| 37 | + runs-on: ubuntu-latest |
| 38 | + environment: |
| 39 | + name: pypi |
| 40 | + url: https://pypi.org/project/yara-python-dex/ |
| 41 | + permissions: |
| 42 | + id-token: write |
| 43 | + contents: read |
| 44 | + actions: read |
53 | 45 |
|
54 | | - steps: |
55 | | - - name: Set up Python |
56 | | - uses: actions/setup-python@v5.3.0 |
57 | | - with: |
58 | | - python-version: '3.x' |
59 | | - - name: Install twine |
60 | | - run: | |
61 | | - python -m pip install --upgrade pip |
62 | | - pip install twine |
63 | | - - name: Download Artifacts |
64 | | - uses: actions/download-artifact@v5.0.0 |
65 | | - with: |
66 | | - name: wheels |
67 | | - path: ./wheels |
68 | | - - name: Publish |
69 | | - env: |
70 | | - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
71 | | - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
72 | | - run: twine upload ./wheels/* --skip-existing |
| 46 | + steps: |
| 47 | + - name: Download Artifacts |
| 48 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 49 | + with: |
| 50 | + pattern: wheels-* |
| 51 | + path: dist |
| 52 | + merge-multiple: true |
| 53 | + |
| 54 | + - name: Publish package distributions to PyPI |
| 55 | + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |
| 56 | + with: |
| 57 | + # Many native wheels plus Sigstore attestations can exceed GitHub's |
| 58 | + # ~5 minute OIDC token lifetime. |
| 59 | + attestations: false |
| 60 | + skip-existing: true |
0 commit comments