Skip to content

Commit 44e89f1

Browse files
authored
Merge pull request #9 from MobSF/update-ci
Bump yara-python-dex to 1.1.0 and fix publishing
2 parents 8a6824a + 1ab3c8a commit 44e89f1

7 files changed

Lines changed: 87 additions & 159 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly

‎.github/workflows/build_arm.yml‎

Lines changed: 0 additions & 66 deletions
This file was deleted.

‎.github/workflows/build_publish.yml‎

Lines changed: 40 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,57 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
name: Build wheels on ${{ matrix.os }}
1013
runs-on: ${{ matrix.os }}
1114
strategy:
15+
fail-fast: false
1216
matrix:
13-
os: [ubuntu-latest, windows-latest, macOS-latest]
17+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
1418

1519
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
2624

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
4227

43-
- uses: actions/upload-artifact@v4.6.2
44-
name: Upload wheels
28+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4529
with:
46-
name: wheels
47-
path: ./wheels/*.whl
30+
name: wheels-${{ matrix.os }}
31+
path: ./wheelhouse/*.whl
32+
if-no-files-found: error
4833

4934
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
5345

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

‎.github/workflows/build_test.yml‎

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,23 @@ name: Build Test
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
name: Build wheels on ${{ matrix.os }}
811
runs-on: ${{ matrix.os }}
912
strategy:
13+
fail-fast: false
1014
matrix:
11-
os: [ubuntu-latest, windows-latest, macOS-latest]
15+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
1216

1317
steps:
14-
- uses: actions/checkout@v5.0.0
15-
16-
- uses: actions/setup-python@v5.6.0
17-
name: Install Python
18-
19-
- name: Install cibuildwheel
20-
run: python -m pip install cibuildwheel==4.2.1
21-
22-
- name: Get submodules
23-
run: git submodule update --init --recursive
18+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19+
with:
20+
submodules: recursive
21+
persist-credentials: false
2422

25-
- name: Build wheels for Windows
26-
if: startsWith(matrix.os, 'windows')
27-
run: |
28-
python -m cibuildwheel --output-dir wheels
29-
env:
30-
CIBW_SKIP: "cp27-* pp27-*" # skip Python 2.7 wheels
31-
CIBW_ENABLE: "pypy pypy-eol"
32-
33-
- name: Build wheels for mac and manylinux
34-
if: "!startsWith(matrix.os, 'windows')"
35-
run: |
36-
python -m cibuildwheel --output-dir wheels
37-
env:
38-
CIBW_ARCHS_MACOS: "auto auto32 x86_64 universal2 arm64"
39-
CIBW_ENABLE: "pypy pypy-eol"
23+
- name: Build wheels
24+
uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1

‎.github/workflows/test.yml‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@ name: Test
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
test:
7-
810
runs-on: ubuntu-latest
911

1012
steps:
11-
- uses: actions/checkout@v5.0.0
12-
- name: Set up Python
13-
uses: actions/setup-python@v5.6.0
14-
with:
15-
python-version: '3.x'
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel
20-
- name: Build
21-
run: |
22-
git submodule update --init --recursive
23-
python setup.py bdist_wheel
13+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14+
with:
15+
submodules: recursive
16+
persist-credentials: false
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
20+
with:
21+
python-version: "3.x"
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel
27+
28+
- name: Build
29+
run: python setup.py bdist_wheel

‎pyproject.toml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tool.cibuildwheel]
2+
# Build CPython betas/RCs when cibuildwheel ships them. Stable new CPython
3+
# versions land automatically once Dependabot bumps pypa/cibuildwheel.
4+
enable = ["cpython-prerelease", "pypy", "pypy-eol"]
5+
# 32-bit is no longer in the default manylinux images used by cibuildwheel 4.
6+
skip = ["*-win32", "*_i686"]
7+
8+
[tool.cibuildwheel.macos]
9+
archs = ["x86_64", "arm64"]

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def run(self):
315315

316316
setup(
317317
name='yara-python-dex',
318-
version='1.0.9',
318+
version='1.1.0',
319319
description='Python interface for YARA',
320320
long_description=readme,
321321
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)