-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (99 loc) · 3.12 KB
/
release-all.yml
File metadata and controls
106 lines (99 loc) · 3.12 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release all changed packages
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
default: 'dev'
type: choice
options:
- dev
- stable
publish_to:
description: 'Publish to'
required: true
default: 'testpypi'
type: choice
options:
- testpypi
- pypi
permissions:
contents: write
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Run tests
run: |
uv sync
uv run pytest -x -q
- name: Run lint
run: uv run ruff check hexdag/ hexdag_plugins/
detect:
needs: test
runs-on: ubuntu-latest
outputs:
hexdag: ${{ steps.check.outputs.hexdag }}
plugins: ${{ steps.check.outputs.plugins }}
studio: ${{ steps.check.outputs.studio }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Detect changed packages
id: check
run: |
CHANGED=$(python scripts/detect_changes.py)
echo "Changed packages: $CHANGED"
echo "hexdag=$(echo $CHANGED | python -c 'import sys,json; print(str("hexdag" in json.load(sys.stdin)).lower())')" >> $GITHUB_OUTPUT
echo "plugins=$(echo $CHANGED | python -c 'import sys,json; print(str("hexdag-plugins" in json.load(sys.stdin)).lower())')" >> $GITHUB_OUTPUT
echo "studio=$(echo $CHANGED | python -c 'import sys,json; print(str("hexdag-studio" in json.load(sys.stdin)).lower())')" >> $GITHUB_OUTPUT
release-hexdag:
needs: detect
if: needs.detect.outputs.hexdag == 'true'
uses: ./.github/workflows/release.yml
with:
release_type: ${{ inputs.release_type }}
publish_to: ${{ inputs.publish_to }}
skip_tests: true
secrets: inherit
permissions:
contents: write
id-token: write
release-plugins:
needs: [detect, release-hexdag]
if: always() && needs.detect.outputs.plugins == 'true' && (needs.release-hexdag.result == 'success' || needs.release-hexdag.result == 'skipped')
uses: ./.github/workflows/release-plugins.yml
with:
release_type: ${{ inputs.release_type }}
publish_to: ${{ inputs.publish_to }}
skip_tests: true
pull_latest: true
secrets: inherit
permissions:
contents: write
id-token: write
release-studio:
needs: [detect, release-plugins]
if: always() && needs.detect.outputs.studio == 'true' && (needs.release-plugins.result == 'success' || needs.release-plugins.result == 'skipped')
uses: ./.github/workflows/release-studio.yml
with:
release_type: ${{ inputs.release_type }}
publish_to: ${{ inputs.publish_to }}
skip_tests: true
pull_latest: true
secrets: inherit
permissions:
contents: write
id-token: write