Skip to content

Commit 0605cb0

Browse files
authored
Remove dev branch support (#495)
Project Mu is dropping the concept of "dev" and "release" branches in favor of having only a "release" branch. This change reverts support added for the branch split. Signed-off-by: Michael Kubacki <[email protected]>
1 parent fa57516 commit 0605cb0

File tree

7 files changed

+20
-456
lines changed

7 files changed

+20
-456
lines changed

.github/workflows/ReleaseDrafter.yml

Lines changed: 11 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#
1212
# 1. A "latest release branch"
1313
# - Example: `release/202405`
14-
# - Config file: `release-draft-config-n.yml` and `release-draft-config-n-dev.yml`
14+
# - Config file: `release-draft-config-n.yml`
1515
# 2. A "previous release branch"
1616
# - Example: `release/202311`
17-
# - Config file: `release-draft-config-n-1.yml` and `release-draft-config-n-1-dev.yml`
17+
# - Config file: `release-draft-config-n-1.yml`
1818
# 3. A "main branch"
1919
# - Example: `main`
2020
# - Config file: `release-draft-config.yml`
@@ -72,135 +72,31 @@ jobs:
7272
run: |
7373
fileContent=$(cat "${FILE_PATH}")
7474
latestMuReleaseBranch=$(echo "$fileContent" | grep -oP '(?<=latest_mu_release_branch = ").*(?=")')
75-
latestMuDevBranch=$(echo "$latestMuReleaseBranch" | sed 's/release/dev/')
7675
previousMuReleaseBranch=$(echo "$fileContent" | grep -oP '(?<=previous_mu_release_branch = ").*(?=")')
77-
previousMuDevBranch=$(echo "$previousMuReleaseBranch" | sed 's/release/dev/')
78-
echo "latest_mu_release_branch=${latestMuReleaseBranch}" >> $GITHUB_ENV
79-
echo "latest_mu_dev_branch=${latestMuDevBranch}" >> $GITHUB_ENV
80-
echo "latest_mu_dev_branch_full=refs/heads/${latestMuDevBranch}" >> $GITHUB_ENV
81-
echo "latest_mu_release_branch_full=refs/heads/${latestMuReleaseBranch}" >> $GITHUB_ENV
82-
echo "previous_mu_release_branch=${previousMuReleaseBranch}" >> $GITHUB_ENV
83-
echo "previous_mu_dev_branch=${previousMuDevBranch}" >> $GITHUB_ENV
84-
echo "previous_mu_dev_branch_full=refs/heads/${previousMuDevBranch}" >> $GITHUB_ENV
85-
echo "previous_mu_release_branch_full=refs/heads/${previousMuReleaseBranch}" >> $GITHUB_ENV
86-
- name: Build a ${{ env.latest_mu_release_branch }} Draft
87-
if: ${{ startsWith(github.ref, env.latest_mu_dev_branch_full) }}
76+
echo "latest_mu_branch=${latestMuReleaseBranch}" >> $GITHUB_ENV
77+
echo "latest_mu_branch_full=refs/heads/${latestMuReleaseBranch}" >> $GITHUB_ENV
78+
echo "previous_mu_branch=${previousMuReleaseBranch}" >> $GITHUB_ENV
79+
echo "previous_mu_branch_full=refs/heads/${previousMuReleaseBranch}" >> $GITHUB_ENV
80+
- name: Build a ${{ env.latest_mu_branch }} Draft
81+
if: ${{ startsWith(github.ref, env.latest_mu_branch_full) }}
8882
id: update_draft_n
8983
uses: release-drafter/[email protected]
9084
with:
9185
# Note: Path is relative to .github/
9286
config-name: release-draft-config-n.yml
9387
env:
9488
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
95-
- name: Draft Release for Current (${{ env.latest_mu_release_branch }}) Release Branch
96-
if: steps.update_draft_n.outcome == 'success'
97-
run: |
98-
# Prepare the release body
99-
release_body_path="${{ runner.temp }}/release_body.txt"
100-
release_body=$(cat <<'EOF'
101-
${{ steps.update_draft_n.outputs.body }}
102-
EOF
103-
)
104-
release_body="${release_body//\`/\\\`}"
105-
echo "${release_body}" > $release_body_path
106-
sed -i 's/\\`/`/g' $release_body_path
107-
sed -i '/\**Full Changelog\**:/d' $release_body_path
108-
109-
# Get the new tag and title
110-
new_tag=$(echo "${{ steps.update_draft_n.outputs.tag_name }}" | sed 's/dev-//')
111-
new_title=$(echo "${{ steps.update_draft_n.outputs.tag_name }}" | sed 's/dev/release/')
112-
113-
# Determine the corresponding tag names
114-
existing_tag_prefix=""
115-
tag_regex="v([0-9]{6}).*\."
116-
if [[ $new_tag =~ $tag_regex ]]; then
117-
existing_tag_prefix="${BASH_REMATCH[1]}"
118-
fi
119-
120-
# Delete the template dev draft created
121-
gh release delete "${{ steps.update_draft_n.outputs.tag_name }}" --repo ${{ github.repository }} --yes
122-
123-
# Delete any existing draft releases for this release branch
124-
for tag in $(gh release list --repo ${{ github.repository }} --json tagName,isPrerelease,isDraft --jq ".[] | select(.isDraft == true and .isPrerelease == false and (.tagName | startswith(\"v$existing_tag_prefix\"))) | .tagName"); do
125-
gh release delete "$tag" --repo ${{ github.repository }} --yes
126-
done
127-
128-
gh release create "$new_tag" \
129-
--repo "${{ github.repository }}" \
130-
--target "${{ env.latest_mu_release_branch_full }}" \
131-
--title "$new_title" \
132-
--notes-file "$release_body_path" \
133-
--draft
134-
env:
135-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
136-
- name: Build a ${{ env.previous_mu_release_branch }} Draft
137-
if: ${{ startsWith(github.ref, env.previous_mu_dev_branch_full) }}
89+
- name: Build a ${{ env.previous_mu_branch }} Draft
90+
if: ${{ startsWith(github.ref, env.previous_mu_branch_full) }}
13891
id: update_draft_n_1
13992
uses: release-drafter/[email protected]
14093
with:
14194
# Note: Path is relative to .github/
14295
config-name: release-draft-config-n-1.yml
14396
env:
14497
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
145-
- name: Draft Release for N-1 (${{ env.previous_mu_release_branch }}) Release Branch
146-
if: steps.update_draft_n_1.outcome == 'success'
147-
run: |
148-
# Prepare the release body
149-
release_body_path="${{ runner.temp }}/release_body.txt"
150-
release_body=$(cat <<'EOF'
151-
${{ steps.update_draft_n_1.outputs.body }}
152-
EOF
153-
)
154-
release_body="${release_body//\`/\\\`}"
155-
echo "${release_body}" > $release_body_path
156-
sed -i 's/\\`/`/g' $release_body_path
157-
sed -i '/\**Full Changelog\**:/d' $release_body_path
158-
159-
# Get the new tag and title
160-
new_tag=$(echo "${{ steps.update_draft_n_1.outputs.tag_name }}" | sed 's/dev-//')
161-
new_title=$(echo "${{ steps.update_draft_n_1.outputs.tag_name }}" | sed 's/dev/release/')
162-
163-
# Determine the corresponding tag names
164-
existing_tag_prefix=""
165-
tag_regex="v([0-9]{6}).*\."
166-
if [[ $new_tag =~ $tag_regex ]]; then
167-
existing_tag_prefix="${BASH_REMATCH[1]}"
168-
fi
169-
170-
# Delete the template dev draft created
171-
gh release delete "${{ steps.update_draft_n_1.outputs.tag_name }}" --repo ${{ github.repository }} --yes
172-
173-
# Delete any existing draft releases for this release branch
174-
for tag in $(gh release list --repo ${{ github.repository }} --json tagName,isPrerelease,isDraft --jq ".[] | select(.isDraft == true and .isPrerelease == false and (.tagName | startswith(\"v$existing_tag_prefix\"))) | .tagName"); do
175-
gh release delete "$tag" --repo ${{ github.repository }} --yes
176-
done
177-
178-
gh release create "$new_tag" \
179-
--repo "${{ github.repository }}" \
180-
--target "${{ env.previous_mu_release_branch_full }}" \
181-
--title "$new_title" \
182-
--notes-file "$release_body_path" \
183-
--draft
184-
env:
185-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
186-
- name: Create the ${{ env.latest_mu_dev_branch }} Draft
187-
if: ${{ startsWith(github.ref, env.latest_mu_dev_branch_full) }}
188-
uses: release-drafter/[email protected]
189-
with:
190-
# Note: Path is relative to .github/
191-
config-name: release-draft-config-n-dev.yml
192-
env:
193-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
194-
- name: Create the ${{ env.previous_mu_dev_branch }} Draft
195-
if: ${{ startsWith(github.ref, env.previous_mu_dev_branch_full) }}
196-
uses: release-drafter/[email protected]
197-
with:
198-
# Note: Path is relative to .github/
199-
config-name: release-draft-config-n-1-dev.yml
200-
env:
201-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
20298
- name: Build the New Release Draft
203-
if: ${{ !startsWith(github.ref, 'refs/heads/release') && !startsWith(github.ref, 'refs/heads/dev') }}
99+
if: ${{ !startsWith(github.ref, 'refs/heads/release') }}
204100
id: update_draft_non_release
205101
uses: release-drafter/[email protected]
206102
with:

.sync/Files.yml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -365,20 +365,6 @@ group:
365365
microsoft/mu_tiano_platforms
366366
microsoft/mu_tiano_plus
367367
368-
# Leaf Workflow - Backport Dev Branch Changes to Release Branch
369-
- files:
370-
- source: .sync/workflows/leaf/backport-to-release-branch.yml
371-
dest: .github/workflows/backport-to-release-branch.yml
372-
template: true
373-
repos: |
374-
microsoft/mu_basecore
375-
microsoft/mu_common_intel_min_platform
376-
microsoft/mu_oem_sample
377-
microsoft/mu_plus
378-
microsoft/mu_silicon_arm_tiano
379-
microsoft/mu_silicon_intel_tiano
380-
microsoft/mu_tiano_plus
381-
382368
# Leaf Workflow - CodeQL
383369
# Note: This workflow should be used in repos that build firmware
384370
# packages from a CI builder (i.e. a CISettings.py file).
@@ -592,30 +578,14 @@ group:
592578
- files:
593579
- source: .sync/workflows/leaf/release-draft.yml
594580
dest: .github/workflows/release-draft.yml
595-
template:
596-
depend_on_backport: true
597581
- source: .sync/workflows/config/release-draft/release-draft-config.yml
598582
dest: .github/release-draft-config-n.yml
599583
template:
600-
filter_to_backport: true
601-
latest: true
602-
release_branch: true
603-
- source: .sync/workflows/config/release-draft/release-draft-config.yml
604-
dest: .github/release-draft-config-n-dev.yml
605-
template:
606-
filter_to_backport: false
607584
latest: true
608585
release_branch: true
609586
- source: .sync/workflows/config/release-draft/release-draft-config.yml
610587
dest: .github/release-draft-config-n-1.yml
611588
template:
612-
filter_to_backport: true
613-
latest: false
614-
release_branch: true
615-
- source: .sync/workflows/config/release-draft/release-draft-config.yml
616-
dest: .github/release-draft-config-n-1-dev.yml
617-
template:
618-
filter_to_backport: false
619589
latest: false
620590
release_branch: true
621591
repos: |
@@ -665,29 +635,13 @@ group:
665635
repos: |
666636
microsoft/mu_tiano_platforms
667637
668-
# Pull Request Template - Common Template - Backport Option
638+
# Pull Request Template - Common Template
669639
- files:
670640
- source: .sync/github_templates/pull_requests/pull_request_template.md
671641
dest: .github/pull_request_template.md
672-
template:
673-
additional_checkboxes:
674-
- Backport to release branch?
675642
repos: |
676643
microsoft/mu_basecore
677644
microsoft/mu_common_intel_min_platform
678-
microsoft/mu_oem_sample
679-
microsoft/mu_plus
680-
microsoft/mu_silicon_arm_tiano
681-
microsoft/mu_silicon_intel_tiano
682-
microsoft/mu_tiano_plus
683-
684-
# Pull Request Template - Common Template
685-
- files:
686-
- source: .sync/github_templates/pull_requests/pull_request_template.md
687-
dest: .github/pull_request_template.md
688-
template:
689-
additional_checkboxes: []
690-
repos: |
691645
microsoft/mu_crypto_release
692646
microsoft/mu_feature_config
693647
microsoft/mu_feature_debugger
@@ -696,10 +650,15 @@ group:
696650
microsoft/mu_feature_ipmi
697651
microsoft/mu_feature_mm_supv
698652
microsoft/mu_feature_uefi_variable
653+
microsoft/mu_oem_sample
654+
microsoft/mu_plus
699655
microsoft/mu_rust_helpers
700656
microsoft/mu_rust_hid
701657
microsoft/mu_rust_pi
658+
microsoft/mu_silicon_arm_tiano
659+
microsoft/mu_silicon_intel_tiano
702660
microsoft/mu_tiano_platforms
661+
microsoft/mu_tiano_plus
703662
microsoft/secureboot_objects
704663
705664
# Rust - Pipeline Files

.sync/github_templates/pull_requests/pull_request_template.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ For details on how to complete these options and their meaning refer to [CONTRIB
99
- [ ] Breaking change?
1010
- [ ] Includes tests?
1111
- [ ] Includes documentation?
12-
{% for additional_checkbox in additional_checkboxes %}
13-
- [ ] {{ additional_checkbox }}
14-
{% endfor %}
1512

1613
## How This Was Tested
1714

.sync/workflows/config/label-issues/regex-pull-requests.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ version: 1
1717
issues: False
1818

1919
labels:
20-
- label: type:backport
21-
type: "pull_request"
22-
body: '\s*\[\s*(x|X){1}\s*\]\s*Backport to release branch\?'
23-
24-
- label: type:backport
25-
type: "pull_request"
26-
authors: ["mu-automation[bot]"]
27-
branch : "repo-sync/mu_devops/default"
28-
base-branch: "dev/20[0-9]{4}"
29-
30-
- label: type:backport
31-
type: "pull_request"
32-
authors: ["dependabot[bot]"]
33-
branch : "dependabot/*"
34-
base-branch: "dev/20[0-9]{4}"
35-
3620
- label: impact:breaking-change
3721
type: "pull_request"
3822
body: '\s*\[\s*(x|X){1}\s*\]\s*Breaking\s*change\?'

.sync/workflows/config/release-draft/release-draft-config.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,23 @@
1919

2020
{% import '../../../Version.njk' as sync_version -%}
2121

22-
{%- if release_branch %}
23-
name-template: 'dev-v$RESOLVED_VERSION'
24-
tag-template: 'dev-v$RESOLVED_VERSION'
25-
{% else %}
2622
name-template: 'v$RESOLVED_VERSION'
2723
tag-template: 'v$RESOLVED_VERSION'
28-
{% endif %}
2924

3025
{# `release_branch` applies a commitish. `latest` then determines the branch to use. -#}
3126
{# If a commitish is not specified, then the `github.ref` value is implicitly used. -#}
3227
{%- if release_branch %}
33-
{%- set latest_mu_dev_branch = "refs/heads/" + (sync_version.latest_mu_release_branch | replace("release", "dev")) %}
34-
{%- set previous_mu_dev_branch = "refs/heads/" + (sync_version.previous_mu_release_branch | replace("release", "dev")) %}
35-
{%- set actual_branch = latest_mu_dev_branch if latest else previous_mu_dev_branch %}
36-
commitish: {{ actual_branch }}
28+
{% set release_branch = "refs/heads/" + (sync_version.latest_mu_release_branch if latest else sync_version.previous_mu_release_branch) %}
29+
commitish: {{ release_branch }}
3730
filter-by-commitish: true
38-
{% if filter_to_backport %}
39-
include-labels: ["type:backport"]
40-
{% endif %}
4131
{% endif %}
4232

4333
template: |
4434
# What's Changed
4535
4636
$CHANGES
4737
48-
{% if release_branch %}
49-
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...dev-v$RESOLVED_VERSION
50-
{% else %}
5138
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
52-
{% endif %}
5339
5440
categories:
5541
- title: '⚠️ Breaking Changes'

0 commit comments

Comments
 (0)