Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ pkg:syft-enclave:
- changed-files:
- any-glob-to-any-file:
- 'packages/syft-enclave/**'

pkg:syft-restrict:
- changed-files:
- any-glob-to-any-file:
- 'packages/syft-restrict/**'
29 changes: 23 additions & 6 deletions .github/workflows/cd-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
- minor
- major

release_syft_restrict:
description: Release syft-restrict
type: boolean
default: true

release_syft_permissions:
description: Release syft-permissions
type: boolean
Expand Down Expand Up @@ -61,23 +66,35 @@
secrets: inherit

# Release order follows dependency graph:
# 1. syft-permissions (no internal deps)
# 2. syft-perms (depends on syft-permissions)
# 3. syft-job + syft-dataset (depend on syft-perms) — parallel
# 4. syft-bg (depends on syft-job)
# 5. syft-client (depends on all above)
# 1. syft-restrict (no internal deps)
# 2. syft-permissions (no internal deps)
# 3. syft-perms (depends on syft-permissions)
# 4. syft-job + syft-dataset (depend on syft-perms) — parallel
# 5. syft-bg (depends on syft-job)
# 6. syft-client (depends on all above)
#

release-syft-restrict:
needs: [call-linting-tests, call-unit-tests, call-integration-tests]
if: >-
!cancelled() && !failure() &&

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines +71 to +80
inputs.release_syft_restrict == true
uses: ./.github/workflows/cd-syft-restrict.yml
with:
bump_type: ${{ inputs.bump_type }}
secrets: inherit

release-syft-permissions:
needs: [call-linting-tests, call-unit-tests, call-integration-tests]
needs: [release-syft-restrict]
if: >-
!cancelled() && !failure() &&
inputs.release_syft_permissions == true
uses: ./.github/workflows/cd-syft-permissions.yml
with:
bump_type: ${{ inputs.bump_type }}
secrets: inherit

release-syft-perms:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: [release-syft-permissions]
if: >-
!cancelled() && !failure() &&
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/cd-syft-restrict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CD - Syft Restrict

on:
workflow_dispatch:
inputs:
bump_type:
description: Version bump type
type: choice
default: patch
options:
- patch
- minor
- major
workflow_call:
inputs:
bump_type:
type: string
required: true

concurrency:
group: 'CD - Syft Restrict'
cancel-in-progress: false

jobs:
deploy-syft-restrict:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Configure git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Bump version
run: |
git pull
pip install packaging
OUTPUT=$(python scripts/bump_version.py syft-restrict ${{ inputs.bump_type }})
VERSION=$(echo "$OUTPUT" | sed -n '1p')
MODIFIED=$(echo "$OUTPUT" | sed -n '2p')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MODIFIED=$MODIFIED" >> $GITHUB_ENV
echo "Bumped syft-restrict to $VERSION (modified: $MODIFIED)"

- name: Build package
working-directory: packages/syft-restrict
run: uv build --out-dir dist

- name: Publish to PyPI
working-directory: packages/syft-restrict
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASS_SYFT_RESTRICT }}
run: uvx twine upload --verbose dist/*

- name: Commit and tag
run: |
git add ${{ env.MODIFIED }}
git commit -m "Release syft-restrict v${{ env.VERSION }}"
git tag "syft-restrict/v${{ env.VERSION }}"
git push origin --follow-tags
23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,26 @@

- name: Run migration tests
run: just test-unit-migration

restrict-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install the project
run: uv sync --all-extras

- name: Install just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

- name: Run restrict tests
run: just test-unit-restrict

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +184 to +204
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ test-unit-migration:
#!/bin/bash
uv run pytest -n auto ./packages/syft-migration/tests

test-unit-restrict:
#!/bin/bash
uv run pytest -n auto ./packages/syft-restrict/tests


test-unit-enclave:
#!/bin/bash
Expand Down
Loading