Skip to content

Commit c0d4b5e

Browse files
committed
Move example to workflow file
Signed-off-by: Keshav Priyadarshi <[email protected]>
1 parent fab9cbb commit c0d4b5e

File tree

3 files changed

+51
-42
lines changed

3 files changed

+51
-42
lines changed

.github/workflows/map-deploy-to-develop-template.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ on:
1010
description: "Comma separated D2D steps to run"
1111
required: false
1212
type: string
13+
repository:
14+
description: "Project's repository. Defaults to workflow's repository."
15+
required: false
16+
type: string
1317

1418
jobs:
1519
run-d2d-pipeline:
1620
runs-on: 'ubuntu-latest'
1721
steps:
1822
- name: Checkout repository
1923
uses: actions/checkout@v4
24+
with:
25+
repository: ${{ inputs.repository || github.repository }}
2026

2127
- name: Download build artifact
2228
uses: actions/download-artifact@v4
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run source to binary mapping on boolean.py
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build-python-wheel:
12+
name: Build python wheel
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
repository: bastikr/boolean.py
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.12
24+
25+
- name: Install pypa/build and twine
26+
run: python -m pip install --user --upgrade build twine packaging pip setuptools
27+
28+
- name: Build a binary wheel
29+
run: python -m build --wheel --outdir dist/
30+
31+
- name: Upload wheel
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: wheel_archives
35+
path: dist/*.whl
36+
37+
map-source-binary:
38+
name: Generate source to binary mapping
39+
needs: build-python-wheel
40+
uses: ./.github/workflows/map-deploy-to-develop-template.yml
41+
with:
42+
artifact-name: wheel_archives
43+
repository: bastikr/boolean.py
44+
steps: "python"

README.md

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -244,49 +244,8 @@ Use this [workflow template](.github/workflows/map-deploy-to-develop-template.ym
244244
steps: "python,java" # Comma separated optional steps. See https://scancodeio.readthedocs.io/en/latest/built-in-pipelines.html#map-deploy-to-develop
245245
```
246246

247-
#### An end-to-end working example for Python projects:
247+
See an end-to-end working example for a python project [here](.github/workflows/map-source-binary-boolean-py.yml)
248248

249-
```yaml
250-
name: Run source to binary mapping on tag
251-
252-
on:
253-
workflow_dispatch:
254-
push:
255-
tags:
256-
- "v*.*.*"
257-
258-
jobs:
259-
build-python-wheel:
260-
name: Build python wheel
261-
runs-on: ubuntu-24.04
262-
263-
steps:
264-
- uses: actions/checkout@v4
265-
- name: Set up Python
266-
uses: actions/setup-python@v5
267-
with:
268-
python-version: 3.12
269-
270-
- name: Install pypa/build and twine
271-
run: python -m pip install --user --upgrade build twine packaging pip setuptools
272-
273-
- name: Build a binary wheel
274-
run: python -m build --wheel --outdir dist/
275-
276-
- name: Upload wheel
277-
uses: actions/upload-artifact@v4
278-
with:
279-
name: wheel_archives
280-
path: dist/*.whl
281-
282-
map-source-binary:
283-
name: Generate source to binary mapping
284-
needs: build-python-wheel
285-
uses: aboutcode-org/scancode-action/.github/workflows/map-deploy-to-develop-template.yml
286-
with:
287-
artifact-name: wheel_archives
288-
steps: "python"
289-
```
290249

291250
## Where are the Scan Results?
292251

0 commit comments

Comments
 (0)