Skip to content

Commit

Permalink
Merge branch 'master' into ankan/staking-migrate-currency-to-fungible-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ank4n authored Oct 22, 2024
2 parents 02ecebd + 356386b commit 3d5a7c0
Show file tree
Hide file tree
Showing 659 changed files with 35,260 additions and 12,560 deletions.
10 changes: 3 additions & 7 deletions .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,10 @@ function find_runtimes() {
# output: none
filter_version_from_input() {
version=$1
regex="(^v[0-9]+\.[0-9]+\.[0-9]+)$|(^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+)$"
regex="^(v)?[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$"

if [[ $version =~ $regex ]]; then
if [ -n "${BASH_REMATCH[1]}" ]; then
echo "${BASH_REMATCH[1]}"
elif [ -n "${BASH_REMATCH[2]}" ]; then
echo "${BASH_REMATCH[2]}"
fi
echo $version
else
echo "Invalid version: $version"
exit 1
Expand Down Expand Up @@ -462,7 +458,7 @@ function get_polkadot_node_version_from_code() {

validate_stable_tag() {
tag="$1"
pattern="^stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"
pattern="^(polkadot-)?stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"

if [[ $tag =~ $pattern ]]; then
echo $tag
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/generate-prdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ def setup_parser(parser=None, pr_required=True):
return parser

def snake_to_title(s):
return ' '.join(word.capitalize() for word in s.split('_'))
return ' '.join(word.capitalize() for word in s.split('_'))

def main(args):
print(f"Args: {args}, force: {args.force}")
setup_yaml()
try:
# Convert snake_case audience arguments to title case
mapped_audiences = [snake_to_title(a) for a in args.audience]
if len(mapped_audiences) == 1:
mapped_audiences = mapped_audiences[0]
from_pr_number(args.pr, mapped_audiences, args.bump, args.force)
return 0
except Exception as e:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check-cargo-check-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
- check-runtime-coretime
- check-runtime-bridge-hubs
- check-runtime-contracts
- check-runtime-starters
- check-runtime-testing
if: always() && !cancelled()
steps:
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/check-features.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
check-labels:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check labels
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:
jobs:
link-checker:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Restore lychee cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v3.3.2 (7. Sep 2023)
Expand All @@ -32,7 +33,7 @@ jobs:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.0 (22. Sep 2023)

- name: Lychee link checker
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # for v1.9.1 (10. Jan 2024)
uses: lycheeverse/lychee-action@2bb232618be239862e31382c5c0eaeba12e5e966 # for v1.9.1 (10. Jan 2024)
with:
args: >-
--config .config/lychee.toml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
jobs:
check-prdoc:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event.pull_request.number != ''
steps:
- name: Checkout repo
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: ./.github/workflows/reusable-preflight.yml
check-semver:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
echo "PRDOC_EXTRA_ARGS=--max-bump minor" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-on-failure: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# This trigger can be problematic, see: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
# In our case it is fine since we only run it on merged Pull Requests and do not execute any of the repo code itself.
pull_request_target:
types: [ closed, labeled ]
types: [closed, labeled]

permissions:
contents: write # so it can comment
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
for (const pullNumber of pullNumbers) {
await github.rest.issues.addLabels({
issue_number: parseInt(pullNumber),
Expand All @@ -84,7 +84,7 @@ jobs:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
const reviewer = '${{ github.event.pull_request.user.login }}';
for (const pullNumber of pullNumbers) {
await github.pulls.createReviewRequest({
owner: context.repo.owner,
Expand Down
70 changes: 47 additions & 23 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,11 @@ concurrency:

jobs:
preflight:
if: contains(github.event.label.name, 'GHA-migration')
uses: ./.github/workflows/reusable-preflight.yml

test-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@v4
- run: forklift cargo doc --workspace --all-features --no-deps
env:
SKIP_WASM_BUILD: 1
test-doc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand All @@ -41,8 +30,9 @@ jobs:

build-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 40
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight, test-rustdoc]
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
Expand Down Expand Up @@ -88,6 +78,23 @@ jobs:
retention-days: 1
if-no-files-found: error

confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All docs jobs passed
# If any new job gets added, be sure to add it to this array
needs: [test-doc, build-rustdoc, build-implementers-guide]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
publish-rustdoc:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -121,13 +128,30 @@ jobs:
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push to GH-Pages branch
uses: github-actions-x/[email protected]
with:
github-token: ${{ steps.app-token.outputs.token }}
push-branch: "gh-pages"
commit-message: "___Updated docs for ${{ github.head_ref || github.ref_name }}___"
force-add: "true"
files: ${{ github.head_ref || github.ref_name }}/ book/
name: devops-parity
email: [email protected]
- name: Push changes to gh-pages
env:
TOKEN: ${{ steps.app-token.outputs.token }}
APP_NAME: "paritytech-upd-ghpages-polkadotsdk"
REF_NAME: ${{ github.head_ref || github.ref_name }}
Green: "\e[32m"
NC: "\e[0m"
run: |
echo "${Green}Git add${NC}"
git add book/
git add ${REF_NAME}/
echo "${Green}git status | wc -l${NC}"
git status | wc -l
echo "${Green}Add new remote with gh app token${NC}"
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
sed -i.bak '/\[http/d' ./.git/config
sed -i.bak '/extraheader/d' ./.git/config
echo "${Green}Git push${NC}"
git config user.email "[email protected]"
git config user.name "${APP_NAME}"
git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
git push origin gh-pages --force
16 changes: 8 additions & 8 deletions .github/workflows/fork-sync-action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Workflow is not supposed to run in the paritytech/polkadot-sdk repo.
# This Workflow is supposed to run only in the forks of the repo,
# This Workflow is supposed to run only in the forks of the repo,
# paritytech-release/polkadot-sdk specifically,
# to automatically maintain the critical fork synced with the upstream.
# This Workflow should be always disabled in the paritytech/polkadot-sdk repo.
Expand All @@ -11,10 +11,10 @@ on:
workflow_dispatch:

jobs:
job_sync_branches:
uses: paritytech-release/sync-workflows/.github/workflows/sync-with-upstream.yml@latest
with:
fork_writer_app_id: ${{ vars.UPSTREAM_CONTENT_SYNC_APP_ID}}
fork_owner: ${{ vars.RELEASE_ORG}}
secrets:
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
job_sync_branches:
uses: paritytech-release/sync-workflows/.github/workflows/sync-with-upstream.yml@main
with:
fork_writer_app_id: ${{ vars.UPSTREAM_CONTENT_SYNC_APP_ID}}
fork_owner: ${{ vars.RELEASE_ORG}}
secrets:
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-check-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-on-failure: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-claim-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-on-failure: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-10_rc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:
inputs:
version:
description: Current release/rc version in format vX.X.X
description: Current release/rc version in format polkadot-stableYYMM

jobs:
tag_rc:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
if [[ -z "${{ inputs.version }}" ]]; then
version=v$(get_polkadot_node_version_from_code)
else
version=$(filter_version_from_input ${{ inputs.version }})
version=$(validate_stable_tag ${{ inputs.version }})
fi
echo "$version"
echo "version=$version" >> $GITHUB_OUTPUT
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
tags:
# Catches v1.2.3 and v1.2.3-rc1
- v[0-9]+.[0-9]+.[0-9]+*
# - polkadot-stable[0-9]+* Activate when the release process from release org is setteled

workflow_dispatch:
inputs:
Expand All @@ -25,7 +26,7 @@ jobs:
build-runtimes:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
excluded_runtimes: "asset-hub-rococo bridge-hub-rococo contracts-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
build_opts: "--features on-chain-release-build"

build-binaries:
Expand Down Expand Up @@ -79,30 +80,27 @@ jobs:
env:
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASSET_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/asset-hub-rococo-runtime/asset-hub-rococo-srtool-digest.json
ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json
BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-runtime/bridge-hub-rococo-srtool-digest.json
BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json
COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/collectives-westend-runtime/collectives-westend-srtool-digest.json
CONTRACTS_ROCOCO_DIGEST: ${{ github.workspace}}/contracts-rococo-runtime/contracts-rococo-srtool-digest.json
CORETIME_ROCOCO_DIGEST: ${{ github.workspace}}/coretime-rococo-runtime/coretime-rococo-srtool-digest.json
CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/coretime-westend-runtime/coretime-westend-srtool-digest.json
GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/glutton-westend-runtime/glutton-westend-srtool-digest.json
PEOPLE_ROCOCO_DIGEST: ${{ github.workspace}}/people-rococo-runtime/people-rococo-srtool-digest.json
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json
ROCOCO_DIGEST: ${{ github.workspace}}/rococo-runtime/rococo-srtool-digest.json
WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json
shell: bash
run: |
. ./.github/scripts/common/lib.sh
export REF1=$(get_latest_release_tag)
if [[ -z "${{ inputs.version }}" ]]; then
export REF2="${{ github.ref_name }}"
echo "REF2: ${REF2}"
else
export REF2="${{ inputs.version }}"
echo "REF2: ${REF2}"
fi
echo "REL_TAG=$REF2" >> $GITHUB_ENV
export VERSION=$(echo "$REF2" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
export VERSION=$(echo "$REF2" | sed -E 's/.*(stable[0-9]+).*$/\1/')
./scripts/release/build-changelogs.sh
Expand Down
Loading

0 comments on commit 3d5a7c0

Please sign in to comment.