Skip to content

Commit ebeacb0

Browse files
jperkingithub-actions[bot]
authored andcommitted
.github: Add workflows.
1 parent 8bfd076 commit ebeacb0

2 files changed

Lines changed: 196 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Create quarterly feature branches
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
quarter:
7+
description: 'Quarterly branch (e.g. 2025Q4)'
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ inputs.quarter }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
create-features:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
feature:
25+
- macos
26+
- miscfix
27+
- pbulk
28+
- pbulkmulti
29+
- performance
30+
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Configure github-actions bot
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40+
41+
- name: Fetch NetBSD/pkgsrc.git
42+
run: |
43+
git remote add netbsd https://github.com/NetBSD/pkgsrc.git
44+
git fetch netbsd
45+
46+
- name: Create feature/${{ matrix.feature }}/${{ inputs.quarter }}
47+
env:
48+
QUARTER: ${{ inputs.quarter }}
49+
run: |
50+
git checkout -B feature/${{ matrix.feature }}/"$QUARTER" origin/feature/${{ matrix.feature }}/trunk
51+
git rebase --committer-date-is-author-date --onto netbsd/pkgsrc-"$QUARTER" netbsd/trunk
52+
53+
- name: Push feature/${{ matrix.feature }}/${{ inputs.quarter }}
54+
env:
55+
QUARTER: ${{ inputs.quarter }}
56+
run: |
57+
git push --force origin feature/${{ matrix.feature }}/"$QUARTER"

‎.github/workflows/rebase.yml‎

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Rebase branches against NetBSD
2+
3+
on:
4+
schedule:
5+
- cron: "17 * * * *"
6+
workflow_dispatch:
7+
inputs:
8+
illumos:
9+
description: 'Rebase release/trunk branch'
10+
type: boolean
11+
default: false
12+
macos:
13+
description: 'Rebase release/macos branch'
14+
type: boolean
15+
default: false
16+
17+
permissions:
18+
contents: write
19+
20+
concurrency:
21+
group: ${{ github.workflow }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
features:
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
branch:
32+
- feature/macos/trunk
33+
- feature/miscfix/trunk
34+
- feature/pbulk/trunk
35+
- feature/pbulkmulti/trunk
36+
- feature/performance/trunk
37+
- trunk
38+
39+
steps:
40+
- uses: actions/checkout@v6
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Configure github-actions bot
45+
run: |
46+
git config user.name "github-actions[bot]"
47+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
48+
49+
- name: Fetch NetBSD/pkgsrc.git
50+
run: |
51+
git remote add netbsd https://github.com/NetBSD/pkgsrc.git
52+
git fetch netbsd
53+
54+
- name: Rebase ${{ matrix.branch }}
55+
run: |
56+
git checkout ${{ matrix.branch }}
57+
git rebase --committer-date-is-author-date netbsd/trunk
58+
59+
- name: Push ${{ matrix.branch }}
60+
run: |
61+
git push --force origin ${{ matrix.branch }}
62+
63+
illumos:
64+
needs: features
65+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.illumos }}
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- uses: actions/checkout@v6
70+
with:
71+
fetch-depth: 0
72+
submodules: true
73+
74+
- name: Configure github-actions bot
75+
run: |
76+
git config user.name "github-actions[bot]"
77+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
78+
79+
- name: Rebase release/trunk
80+
run: |
81+
git checkout release/trunk
82+
git submodule update --init --recursive
83+
git submodule foreach '
84+
git fetch --all
85+
main=$(git remote show origin | awk "/HEAD branch/ {print \$NF}")
86+
git checkout $main
87+
git pull
88+
'
89+
git reset --hard origin/feature/miscfix/trunk
90+
for feature in pbulk pbulkmulti performance; do
91+
git merge --no-edit origin/feature/${feature}/trunk
92+
done
93+
git submodule add https://github.com/TritonDataCenter/pkgsrc-extra.git extra
94+
git submodule add https://github.com/TritonDataCenter/pkgsrc-joyent.git joyent
95+
git submodule add https://github.com/TritonDataCenter/pkgsrc-wip.git wip
96+
git add .gitmodules
97+
git commit -m "Add submodules."
98+
if [ "$(git rev-parse HEAD^{tree})" = "$(git rev-parse origin/release/trunk^{tree})" ]; then
99+
echo "No upstream changes, skipping push."
100+
exit 0
101+
fi
102+
git push --force origin release/trunk
103+
104+
macos:
105+
needs: features
106+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos }}
107+
runs-on: ubuntu-latest
108+
109+
steps:
110+
- uses: actions/checkout@v6
111+
with:
112+
fetch-depth: 0
113+
submodules: true
114+
115+
- name: Configure github-actions bot
116+
run: |
117+
git config user.name "github-actions[bot]"
118+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
119+
120+
- name: Rebase release/macos
121+
run: |
122+
git checkout release/macos
123+
git submodule update --init --recursive
124+
git submodule foreach '
125+
git fetch --all
126+
main=$(git remote show origin | awk "/HEAD branch/ {print \$NF}")
127+
git checkout $main
128+
git pull
129+
'
130+
git reset --hard origin/feature/macos/trunk
131+
git merge --no-edit origin/feature/performance/trunk
132+
git submodule add https://github.com/TritonDataCenter/pkgsrc-extra.git extra
133+
git add .gitmodules
134+
git commit -m "Add submodules."
135+
if [ "$(git rev-parse HEAD^{tree})" = "$(git rev-parse origin/release/macos^{tree})" ]; then
136+
echo "No upstream changes, skipping push."
137+
exit 0
138+
fi
139+
git push --force origin release/macos

0 commit comments

Comments
 (0)