Release - Branch off stable branch #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release - Branch off stable branch | |
on: | |
workflow_dispatch: | |
inputs: | |
stable_version: | |
description: New stable version in the format stableYYMM | |
required: true | |
type: string | |
node_version: | |
description: Version of the polkadot node in the format X.XX.X (e.g. 1.15.0) | |
required: true | |
jobs: | |
prepare-tooling: | |
runs-on: ubuntu-latest | |
outputs: | |
node_version: ${{ steps.validate_inputs.outputs.node_version }} | |
stable_version: ${{ steps.validate_inputs.outputs.stable_version }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7 | |
- name: Validate inputs | |
id: validate_inputs | |
run: | | |
. ./.github/scripts/common/lib.sh | |
node_version=$(filter_version_from_input "${{ inputs.node_version }}") | |
echo "node_version=${node_version}" >> $GITHUB_OUTPUT | |
stable_version=$(validate_stable_tag ${{ inputs.stable_version }}) | |
echo "stable_version=${stable_version}" >> $GITHUB_OUTPUT | |
create-stable-branch: | |
needs: [prepare-tooling] | |
runs-on: ubuntu-latest | |
environment: release | |
env: | |
PGP_KMS_KEY: ${{ secrets.PGP_KMS_SIGN_COMMITS_KEY }} | |
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
STABLE_BRANCH_NAME: ${{ needs.prepare-tooling.outputs.stable_version }} | |
steps: | |
- name: Install pgpkkms | |
run: | | |
# Install pgpkms that is used to sign commits | |
pip install git+https://github.com/paritytech-release/pgpkms.git@5a8f82fbb607ea102d8c178e761659de54c7af69 | |
- name: Generate content write token for the release automation | |
id: generate_write_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.RELEASE_AUTOMATION_APP_ID }} | |
private-key: ${{ secrets.RELEASE_AUTOMATION_APP_PRIVATE_KEY }} | |
owner: paritytech | |
- name: Checkout sources | |
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7 | |
with: | |
ref: master | |
token: ${{ steps.generate_write_token.outputs.token }} | |
- name: Import gpg keys | |
run: | | |
. ./.github/scripts/common/lib.sh | |
import_gpg_keys | |
- name: Config git | |
run: | | |
git config --global commit.gpgsign true | |
git config --global gpg.program /home/runner/.local/bin/pgpkms-git | |
git config --global user.name "ParityReleases" | |
git config --global user.email "[email protected]" | |
git config --global user.signingKey "D8018FBB3F534D866A45998293C5FB5F6A367B51" | |
- name: Create stable branch | |
run: | | |
git checkout -b "$STABLE_BRANCH_NAME" | |
git show-ref "$STABLE_BRANCH_NAME" | |
- name: Bump versions, reorder prdocs and push stable branch | |
env: | |
GH_TOKEN: ${{ steps.generate_write_token.outputs.token }} | |
run: | | |
. ./.github/scripts/release/release_lib.sh | |
NODE_VERSION="${{ needs.prepare-tooling.outputs.node_version }}" | |
NODE_VERSION_PATTERN="\(NODE_VERSION[^=]*= \)\".*\"" | |
set_version $NODE_VERSION_PATTERN $NODE_VERSION "polkadot/node/primitives/src/lib.rs" | |
commit_with_message "Bump node version to $NODE_VERSION in polkadot-cli" | |
set_version $NODE_VERSION_PATTERN $NODE_VERSION "cumulus/polkadot-omni-node/lib/src/nodes/mod.rs" | |
commit_with_message "Bump node version to $NODE_VERSION in polkadot-omni-node-lib" | |
SPEC_VERSION=$(get_spec_version $NODE_VERSION) | |
runtimes_list=$(get_filtered_runtimes_list) | |
set_spec_versions $SPEC_VERSION "${runtimes_list[@]}" | |
# TODO: clarify what to do with the polkadot-parachain binary | |
# Set new version for polkadot-parachain binary to match the polkadot node binary | |
# set_polkadot_parachain_binary_version $NODE_VERSION "cumulus/polkadot-parachain/Cargo.toml" | |
reorder_prdocs $STABLE_BRANCH_NAME | |
gh auth setup-git | |
git push origin "$STABLE_BRANCH_NAME" |