Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding release procedures to Github Actions #355

Open
wants to merge 1 commit into
base: branch-23.07
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/release_procedures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release Procedures

on:
workflow_dispatch:
inputs:
current_version:
description: 'Current version of the project'
required: true
type: string
next_version:
description: 'Next version of the project'
required: true
type: string
create_codefreeze_pr:
description: 'Creates/Updates the codefreeze PR'
required: true
type: boolean
default: false
create_next_release_branch:
description: 'Creates the next release branch and configures tags'
required: true
type: boolean
default: false
update_next_release_versions:
description: 'Runs the update-version script and creates a PR with the changes'
required: true
type: boolean
default: false
update_changelog:
description: 'Updates the CHANGELOG.md file for the current release and commits the changes'
required: true
type: boolean
default: false
merge_release_branch:
description: 'Merges the code freeze release branch, creates the release tag, and creates a new Github release'
required: true
type: boolean
default: false
Comment on lines +34 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: Looks like some of these inputs are unused.

Question: Should the unused inputs be removed?


env:
GITHUB_TOKEN: ${{ secrets.PROJECT_MANAGEMENT_PAT }}
REPO_NAME: 'MRC'
VERSION: ${{ inputs.current_version }}
FULL_VERSION: ${{ inputs.current_version }}.00
NEXT_VERSION: ${{ inputs.next_version }}
NEXT_FULL_VERSION: ${{ inputs.next_version }}.00

jobs:
create_codefreeze_pr:
if: ${{ inputs.create_codefreeze_pr }}
name: Create Codefreeze PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'mrc'
fetch-depth: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Do we need to fetch all history for all branches and tags?

- name: Create PR
run: |
cat ci/release/pr_code_freeze_template.md | envsubst | \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: Using envsubst here could be dangerous due GITHUB_TOKEN being in the environment. Wondering what the chances are we accidentally expose the token this way. I imagine it would require both updating the template and running the workflow from the dashboard. Seems unlikely, but still possible.

Question: Is having GITHUB_TOKEN in the environment necessary?

Question: Are there other secrets that could be exposed with envsubst?

gh pr create --base main --head branch-${VERSION} \
--title "[RELEASE] ${REPO_NAME} v${VERSION}" \
--body-file - \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: This is pretty cool. I didn't know you could pipe the file in like that.

--label "! - Release"
11 changes: 11 additions & 0 deletions ci/release/pr_code_freeze_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## :snowflake: Code freeze for `branch-${VERSION}` and `v${VERSION}` release

### What does this mean?
Only critical/hotfix level issues should be merged into `branch-${VERSION}` until release (merging of this PR).

All other development PRs should be retargeted towards the next release branch: `branch-${NEXT_VERSION}`.

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `branch-${VERSION}` into `main` for the release
Loading