-
Notifications
You must be signed in to change notification settings - Fork 23
171 lines (170 loc) · 5.5 KB
/
Copy pathrelease-master.yml
File metadata and controls
171 lines (170 loc) · 5.5 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Release (master)
permissions: write-all
on:
pull_request:
types:
- closed
branches:
- master
jobs:
build-docs:
if: github.event.pull_request.merged == true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/docs
with:
os: ${{ matrix.os }}
run-tests:
if: github.event.pull_request.merged == true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/setup
with:
os: ${{ matrix.os }}
- uses: ./.github/workflows/actions/compile
with:
build-log-output-file: "warnings-new"
- name: Test the library
run: make test
run-tests-python:
if: github.event.pull_request.merged == true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.13"]
install-type: ["src", "tarball"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/setup
with:
os: ${{ matrix.os }}
- name: Set up Python and its dependencies ${{ inputs.python-version }}
uses: ./.github/workflows/actions/setup-python
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Write the released version to VERSION file
shell: bash
run: |
echo "v0.0.0-dev.1" > VERSION
echo "v0.0.0-dev.1" > bindings/python/VERSION
- name: Compile the Python bindings from the source
uses: ./.github/workflows/actions/compile-python-src
- name: Compile the Python bindings from the tarball
if: matrix.install-type == 'tarball'
uses: ./.github/workflows/actions/compile-python-tarball
- name: Test the Python bindings
uses: ./.github/workflows/actions/test-python
release:
needs: [build-docs, run-tests, run-tests-python]
runs-on: ubuntu-latest
outputs:
new-tag: ${{ steps.bump.outputs.new-tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/github-actions-git-config
- uses: ./.github/workflows/actions/bump-version
id: bump
sync-devel-with-master:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/github-actions-git-config
- name: Create sync branch
run: |
git checkout -B sync/master-into-devel origin/devel
git merge origin/master --no-edit
git push origin sync/master-into-devel --force
# - name: Merge master into devel
# run: |
# git checkout -B devel origin/devel
# git merge origin/master --no-edit
# git push origin devel
- name: Create or update sync PR
env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
PR_NUMBER=$(gh pr list \
--head sync/master-into-devel \
--base devel \
--json number \
--jq '.[0].number')
if [ -z "$PR_NUMBER" ]; then
gh pr create \
--head sync/master-into-devel \
--base devel \
--title "chore: Sync 'master' into 'devel'" \
--body "Automated sync of 'master' into 'devel' after release. Auto-merged when all checks pass." \
--label automated/sync
else
echo "PR #$PR_NUMBER already exists, updated branch."
fi
- name: Enable auto-merge on sync PR
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
PR_NUMBER=$(gh pr list \
--head sync/master-into-devel \
--base devel \
--json number \
--jq '.[0].number')
gh pr merge "$PR_NUMBER" --auto --merge
deploy-docs:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/docs
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/_build/html
deploy-pypi:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: ./.github/workflows/actions/deploy-pypi
with:
os: ${{ runner.os }}
python-version: ${{ matrix.python-version }}
version: ${{ needs.release.outputs.new-tag }}
pypi-token: ${{ secrets.PYPI_SECRET_TOKEN }}