-
-
Notifications
You must be signed in to change notification settings - Fork 2k
73 lines (62 loc) · 1.89 KB
/
Copy pathcd-syft-perms.yml
File metadata and controls
73 lines (62 loc) · 1.89 KB
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
name: CD - Syft Perms
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 Perms'
cancel-in-progress: false
jobs:
deploy-syft-perms:
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-perms ${{ 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-perms to $VERSION (modified: $MODIFIED)"
- name: Build package
working-directory: packages/syft-perms
run: uv build --out-dir dist
- name: Publish to PyPI
working-directory: packages/syft-perms
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASS_SYFT_PERMS }}
run: uvx twine upload --verbose dist/*
- name: Commit and tag
run: |
git add ${{ env.MODIFIED }}
git commit -m "Release syft-perms v${{ env.VERSION }}"
git tag "syft-perms/v${{ env.VERSION }}"
git push origin --follow-tags