Skip to content

Commit 87e31d5

Browse files
committed
Add CI scripts
1 parent 6f80afe commit 87e31d5

File tree

5 files changed

+253
-0
lines changed

5 files changed

+253
-0
lines changed

.github/labels.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# Labels names are important as they are used by Release Drafter to decide
3+
# regarding where to record them in changelog or if to skip them.
4+
#
5+
# The repository labels will be automatically configured using this file and
6+
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
7+
- name: breaking
8+
description: Breaking Changes
9+
color: bfd4f2
10+
- name: bug
11+
description: Something isn't working
12+
color: d73a4a
13+
- name: build
14+
description: Build System and Dependencies
15+
color: bfdadc
16+
- name: ci
17+
description: Continuous Integration
18+
color: 4a97d6
19+
- name: dependencies
20+
description: Pull requests that update a dependency file
21+
color: 0366d6
22+
- name: documentation
23+
description: Improvements or additions to documentation
24+
color: 0075ca
25+
- name: duplicate
26+
description: This issue or pull request already exists
27+
color: cfd3d7
28+
- name: enhancement
29+
description: New feature or request
30+
color: a2eeef
31+
- name: github_actions
32+
description: Pull requests that update Github_actions code
33+
color: "000000"
34+
- name: good first issue
35+
description: Good for newcomers
36+
color: 7057ff
37+
- name: help wanted
38+
description: Extra attention is needed
39+
color: 008672
40+
- name: invalid
41+
description: This doesn't seem right
42+
color: e4e669
43+
- name: performance
44+
description: Performance
45+
color: "016175"
46+
- name: python
47+
description: Pull requests that update Python code
48+
color: 2b67c6
49+
- name: question
50+
description: Further information is requested
51+
color: d876e3
52+
- name: refactoring
53+
description: Refactoring
54+
color: ef67c4
55+
- name: removal
56+
description: Removals and Deprecations
57+
color: 9ae7ea
58+
- name: style
59+
description: Style
60+
color: c120e5
61+
- name: testing
62+
description: Testing
63+
color: b1fc6f
64+
- name: wontfix
65+
description: This will not be worked on
66+
color: ffffff

.github/release-drafter.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
autolabeler:
2+
- label: "github_actions"
3+
files:
4+
- ".github/workflows/*"
5+
- label: "ci"
6+
files:
7+
- ".github/*"
8+
- label: "documentation"
9+
files:
10+
- "*.md"
11+
branch:
12+
- '/docs{0,1}\/.+/'
13+
- label: "bug"
14+
branch:
15+
- '/fix\/.+/'
16+
title:
17+
- "/fix/i"
18+
- label: "enhancement"
19+
branch:
20+
- '/feature\/.+/'
21+
- '/add\/.+/'
22+
- '/support\/.+/'
23+
title:
24+
- "/add/i"
25+
- "/support/i"
26+
- label: "refactoring"
27+
branch:
28+
- '/refactor\/.+/'
29+
title:
30+
- "/refactor/i"
31+
- label: "removal"
32+
branch:
33+
- '/deprecate\/.+/'
34+
- '/remove\/.+/'
35+
title:
36+
- "/deprecate/i"
37+
- "/remove/i"
38+
- label: "testing"
39+
branch:
40+
- '/test\/.+/'
41+
title:
42+
- "/test/i"
43+
categories:
44+
- title: ":boom: Breaking Changes"
45+
label: "breaking"
46+
- title: ":rocket: Features"
47+
label: "enhancement"
48+
- title: ":fire: Removals and Deprecations"
49+
label: "removal"
50+
- title: ":beetle: Fixes"
51+
label: "bug"
52+
- title: ":racehorse: Performance"
53+
label: "performance"
54+
- title: ":rotating_light: Testing"
55+
label: "testing"
56+
- title: ":construction_worker: Continuous Integration"
57+
labels:
58+
- "ci"
59+
- "github_actions"
60+
- title: ":books: Documentation"
61+
label: "documentation"
62+
- title: ":hammer: Refactoring"
63+
label: "refactoring"
64+
- title: ":lipstick: Style"
65+
label: "style"
66+
- title: ":package: Dependencies"
67+
labels:
68+
- "dependencies"
69+
- "build"
70+
template: |
71+
## Changes
72+
73+
$CHANGES
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Draft release
2+
3+
on:
4+
workflow_dispatch:
5+
# pull_request event is required only for autolabeler
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
9+
jobs:
10+
update-release-draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: release-drafter/[email protected]
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/labeler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Labeler
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
labeler:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/[email protected]
15+
16+
- name: Run Labeler
17+
uses: crazy-max/[email protected]
18+
with:
19+
skip-delete: true

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
publish-pypi:
11+
name: Publish to PyPI
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repository
15+
uses: actions/[email protected]
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Set up Python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: "3.8"
23+
24+
- name: Upgrade pip
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip --version
28+
29+
- name: Install dependencies
30+
run: |
31+
pip install wheel
32+
pip install tox tox-gh-actions
33+
34+
- name: Test with tox
35+
run: tox
36+
37+
- name: Check passthrough models
38+
run: python scripts/generate_passthrough_modules.py check
39+
40+
- name: Check if there is a parent commit
41+
id: check-parent-commit
42+
run: |
43+
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
44+
45+
- name: Detect new version
46+
id: check-version
47+
if: steps.check-parent-commit.outputs.sha
48+
uses: salsify/[email protected]
49+
with:
50+
create-tag: false
51+
version-command: |
52+
bash -o pipefail -c "cat bioimageio/core/VERSION | jq -r '.version'"
53+
54+
- name: Push tag
55+
id: tag-version
56+
if: steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
57+
uses: mathieudutour/[email protected]
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
custom_tag: ${{ steps.check-version.outputs.current-version }}
61+
62+
- name: Build package
63+
run: |
64+
python setup.py sdist bdist_wheel
65+
66+
- name: Publish package on PyPI
67+
if: steps.tag-version.outputs.new_tag
68+
uses: pypa/[email protected]
69+
with:
70+
user: __token__
71+
password: "${{ secrets.PYPI_TOKEN }}"
72+
packages_dir: dist/
73+
74+
- name: Publish the release notes
75+
uses: release-drafter/[email protected]
76+
with:
77+
publish: "${{ steps.tag-version.outputs.new_tag != '' }}"
78+
tag: "${{ steps.tag-version.outputs.new_tag }}"
79+
env:
80+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)