Skip to content

Commit f99d59a

Browse files
committed
merge: Sync workflow changes from develop
2 parents 1d4d29a + c32d633 commit f99d59a

File tree

2 files changed

+120
-44
lines changed

2 files changed

+120
-44
lines changed
Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
11
name: Build documentation and pack
22
on:
3-
workflow_dispatch:
4-
push:
5-
branches: [ develop ]
6-
pull_request:
7-
branches: [ develop ]
8-
release:
9-
types: [published]
3+
workflow_dispatch:
4+
push:
5+
branches: [develop]
6+
pull_request:
7+
branches: [develop]
108
jobs:
11-
pack:
12-
name: Generate pack
13-
runs-on: ubuntu-22.04
14-
permissions:
15-
contents: write
16-
steps:
17-
- uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0
20-
token: ${{ secrets.GITHUB_TOKEN }}
9+
pack:
10+
name: Generate pack
11+
runs-on: ubuntu-22.04
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
token: ${{ secrets.GITHUB_TOKEN }}
2119

22-
- name: Fetch tags
23-
if: ${{ github.event_name == 'release' }}
24-
run: |
25-
git fetch --tags --force
20+
- name: Fetch tags
21+
if: ${{ github.event_name == 'release' }}
22+
run: |
23+
git fetch --tags --force
2624
27-
- name: get submodules
28-
run: |
29-
git submodule update --init
25+
- name: get submodules
26+
run: |
27+
git submodule update --init
3028
31-
- uses: Open-CMSIS-Pack/gen-pack-action@main
32-
with:
33-
doxygen-version: 1.9.5
34-
packchk-version: 1.3.96
35-
gen-pack-script: ./gen_pack.sh
36-
gen-pack-output: ./output
29+
- uses: Open-CMSIS-Pack/gen-pack-action@main
30+
with:
31+
doxygen-version: 1.9.5
32+
packchk-version: 1.3.96
33+
gen-pack-script: ./gen_pack.sh
34+
gen-pack-output: ./output
3735

38-
- name: Copy pack to cmsis-pack directory
39-
run: |
40-
mkdir -p cmsis-pack
41-
cp -v ./output/*.pack cmsis-pack/ || true
36+
- name: Copy pack to cmsis-pack directory
37+
run: |
38+
mkdir -p cmsis-pack
39+
cp -v ./output/*.pack cmsis-pack/ || true
4240
43-
- name: Commit pack to repository
44-
if: github.event_name == 'push' && github.ref == 'refs/heads/CMSIS-Pack'
45-
run: |
46-
git config user.name "github-actions[bot]"
47-
git config user.email "github-actions[bot]@users.noreply.github.com"
48-
git add cmsis-pack/*.pack
49-
if ! git diff --staged --quiet; then
50-
git commit -m "chore: Update CMSIS pack files [skip ci]"
51-
git push origin HEAD:CMSIS-Pack
52-
fi
41+
- name: Commit pack to repository
42+
if: github.event_name == 'push' && github.ref == 'refs/heads/CMSIS-Pack'
43+
run: |
44+
git config user.name "github-actions[bot]"
45+
git config user.email "github-actions[bot]@users.noreply.github.com"
46+
git add cmsis-pack/*.pack
47+
if ! git diff --staged --quiet; then
48+
git commit -m "chore: Update CMSIS pack files [skip ci]"
49+
git push origin HEAD:CMSIS-Pack
50+
fi

.github/workflows/publish-pack.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Publish pack on release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-pack:
9+
name: Publish pack files to all branches
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Fetch tags
20+
run: |
21+
git fetch --tags --force
22+
23+
- name: Get submodules
24+
run: |
25+
git submodule update --init
26+
27+
- uses: Open-CMSIS-Pack/gen-pack-action@main
28+
with:
29+
doxygen-version: 1.9.5
30+
packchk-version: 1.3.96
31+
gen-pack-script: ./gen_pack.sh
32+
gen-pack-output: ./output
33+
34+
- name: Copy pack to cmsis-pack directory
35+
run: |
36+
mkdir -p cmsis-pack
37+
cp -v ./output/*.pack cmsis-pack/ || true
38+
39+
- name: Get all branches and push pack files
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
44+
# Get list of all remote branches (including CMSIS-Pack)
45+
branches=$(git branch -r | grep -v HEAD | sed 's/origin\///' | sort -u)
46+
47+
echo "Found branches: $branches"
48+
echo ""
49+
50+
for branch in $branches; do
51+
echo "Processing branch: $branch"
52+
53+
# Checkout the branch
54+
git checkout $branch 2>/dev/null || git checkout -b $branch origin/$branch 2>/dev/null
55+
56+
# Copy pack files to cmsis-pack directory
57+
mkdir -p cmsis-pack
58+
cp -v ./output/*.pack cmsis-pack/ 2>/dev/null || true
59+
60+
# Add and commit if there are changes
61+
git add cmsis-pack/*.pack
62+
if ! git diff --staged --quiet; then
63+
git commit -m "chore: Update CMSIS pack files from release [skip ci]"
64+
git push origin $branch
65+
echo "✓ Updated pack files on branch: $branch"
66+
else
67+
echo "- No changes on branch: $branch"
68+
fi
69+
echo ""
70+
done
71+
72+
echo "✓ All branches processed successfully (including CMSIS-Pack)"
73+
74+
- name: Trigger cmake-single-platform workflow
75+
run: |
76+
gh workflow run cmake-single-platform.yml --ref ${{ github.event.release.target_commitish || 'CMSIS-Pack' }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)