Skip to content

Commit

Permalink
Merge branch 'paritytech:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
radiumb authored Aug 26, 2024
2 parents 8c3b1e7 + 52209dc commit 4f9dfa8
Show file tree
Hide file tree
Showing 537 changed files with 55,124 additions and 14,765 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ rustflags = [
"-Aclippy::needless_option_as_deref", # false positives
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
"-Aclippy::extra-unused-type-parameters", # stylistic
]
21 changes: 14 additions & 7 deletions .github/workflows/burnin-label-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ on:
jobs:
notify-devops:
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- name: 'Team: DevOps'
room: '!lUslSijLMgNcEKcAiE:parity.io'

steps:
- name: Notify devops
if: github.event.label.name == 'A1-needsburnin'
uses: s3krit/[email protected]
- name: Send Matrix message to ${{ matrix.channel.name }}
if: startsWith(github.event.label.name, 'A1-')
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
with:
room_id: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ROOM_ID }}
access_token: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ACCESS_TOKEN }}
message: "@room Burn-in request received for the following PR: ${{ github.event.pull_request.html_url }}"
server: "matrix.parity.io"
room_id: ${{ matrix.channel.room }}
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
@room Burn-in request received for the following PR: ${{ github.event.pull_request.html_url }}
4 changes: 2 additions & 2 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3.3.0
- uses: actions/setup-node@v3.7.0
uses: actions/checkout@v3
- uses: actions/setup-node@v3.8.1
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/release-10_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
jobs:
tag_rc:
runs-on: ubuntu-latest
strategy:
matrix:
channel:
- name: "RelEng: Polkadot Release Coordination"
room: '!cqAmzdIcbOFwrdrubV:parity.io'

steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -33,6 +39,7 @@ jobs:
echo "new_tag=$version-rc1" >> $GITHUB_OUTPUT
echo "first_rc=true" >> $GITHUB_OUTPUT
fi
- name: Apply new tag
uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2
with:
Expand All @@ -41,6 +48,7 @@ jobs:
# RELEASE_BRANCH_TOKEN requires public_repo OAuth scope
repo-token: "${{ secrets.RELEASE_BRANCH_TOKEN }}"
tag: ${{ steps.compute_tag.outputs.new_tag }}

- id: create-issue
uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1
# Only create the issue if it's the first release candidate
Expand All @@ -50,11 +58,14 @@ jobs:
VERSION: ${{ steps.compute_tag.outputs.version }}
with:
filename: .github/ISSUE_TEMPLATE/release.md
- name: Send Matrix message
uses: s3krit/[email protected]

- name: Send Matrix message to ${{ matrix.channel.name }}
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
if: steps.create-issue.outputs.url != ''
with:
room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
server: "matrix.parity.io"
message: "Release process for polkadot ${{ steps.compute_tag.outputs.version }} has been started. Tracking issue: ${{ steps.create-issue.outputs.url }}"
room_id: ${{ matrix.channel.room }}
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
Release process for polkadot ${{ steps.compute_tag.outputs.version }} has been started.<br/>
Tracking issue: ${{ steps.create-issue.outputs.url }}
22 changes: 15 additions & 7 deletions .github/workflows/release-30_publish-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Build ${{ matrix.runtime }} runtime
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
image: paritytech/srtool
chain: ${{ matrix.runtime }}
Expand Down Expand Up @@ -181,11 +181,19 @@ jobs:
post_to_matrix:
runs-on: ubuntu-latest
needs: publish-draft-release
strategy:
matrix:
channel:
- name: "RelEng: Polkadot Release Coordination"
room: '!cqAmzdIcbOFwrdrubV:parity.io'

steps:
- name: Internal polkadot channel
uses: s3krit/[email protected]
- name: Send Matrix message to ${{ matrix.channel.name }}
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
with:
room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "**New version of polkadot tagged**: ${{ github.ref }}<br/>Draft release created: ${{ needs.publish-draft-release.outputs.release_url }}"
server: "matrix.parity.io"
room_id: ${{ matrix.channel.room }}
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
**New version of polkadot tagged**: ${{ github.ref }}<br/>
Draft release created: ${{ needs.publish-draft-release.outputs.release_url }}
132 changes: 132 additions & 0 deletions .github/workflows/release-40_publish-rc-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Release - Publish RC Container image
# see https://github.com/paritytech/release-engineering/issues/97#issuecomment-1651372277

on:
workflow_dispatch:
inputs:
release_id:
description: |
Release ID.
You can find it using the command:
curl -s \
-H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/$OWNER/$REPO/releases | \
jq '.[] | { name: .name, id: .id }'
required: true
type: string
registry:
description: "Container registry"
required: true
type: string
default: docker.io
owner:
description: Owner of the container image repo
required: true
type: string
default: parity

env:
RELEASE_ID: ${{ inputs.release_id }}
ENGINE: docker
REGISTRY: ${{ inputs.registry }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_OWNER: ${{ inputs.owner || github.repository_owner }}
REPO: ${{ github.repository }}

jobs:
fetch-artifacts:
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Fetch all artifacts
run: |
. ./scripts/ci/common/lib.sh
fetch_release_artifacts
- name: Cache the artifacts
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
key: artifacts-${{ github.sha }}
path: |
./release-artifacts/**/*
build-container:
runs-on: ubuntu-latest
needs: fetch-artifacts

strategy:
matrix:
binary: ["polkadot", "staking-miner"]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Get artifacts from cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
key: artifacts-${{ github.sha }}
fail-on-cache-miss: true
path: |
./release-artifacts/**/*
- name: Check sha256 ${{ matrix.binary }}
working-directory: ./release-artifacts
run: |
. ../scripts/ci/common/lib.sh
echo "Checking binary ${{ matrix.binary }}"
check_sha256 ${{ matrix.binary }} && echo "OK" || echo "ERR"
- name: Check GPG ${{ matrix.binary }}
working-directory: ./release-artifacts
run: |
. ../scripts/ci/common/lib.sh
import_gpg_keys
check_gpg ${{ matrix.binary }}
- name: Fetch commit and tag
id: fetch_refs
run: |
release=release-${{ inputs.release_id }} && \
echo "release=${release}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
echo "commit=${commit}" >> $GITHUB_OUTPUT
tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) && \
[ "${tag}" != "undefined" ] && echo "tag=${tag}" >> $GITHUB_OUTPUT || \
echo "No tag, doing without"
- name: Build Injected Container image for ${{ matrix.binary }}
env:
BIN_FOLDER: ./release-artifacts
BINARY: ${{ matrix.binary }}
TAGS: ${{join(steps.fetch_refs.outputs.*, ',')}}
run: |
echo "Building container for ${{ matrix.binary }}"
./scripts/ci/dockerfiles/build-injected.sh
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Container image for ${{ matrix.binary }}
id: docker_push
env:
BINARY: ${{ matrix.binary }}
run: |
$ENGINE images | grep ${BINARY}
$ENGINE push --all-tags ${REGISTRY}/${DOCKER_OWNER}/${BINARY}
- name: Check version for the published image for ${{ matrix.binary }}
env:
BINARY: ${{ matrix.binary }}
RELEASE_TAG: ${{ steps.fetch_refs.outputs.release }}
run: |
echo "Checking tag ${RELEASE_TAG} for image ${REGISTRY}/${DOCKER_OWNER}/${BINARY}"
$ENGINE run -i ${REGISTRY}/${DOCKER_OWNER}/${BINARY}:${RELEASE_TAG} --version
2 changes: 1 addition & 1 deletion .github/workflows/release-50_publish-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
file: scripts/ci/dockerfiles/polkadot_injected_release.Dockerfile
file: scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile
tags: |
parity/polkadot:latest
parity/polkadot:${{ github.event.release.tag_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-51_publish-docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
file: scripts/ci/dockerfiles/polkadot_injected_release.Dockerfile
file: scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile
tags: |
parity/polkadot:latest
parity/polkadot:${{ github.event.inputs.version }}
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/release-99_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,29 @@ jobs:
- name: '#polkadot-announcements:matrix.parity.io'
room: '!UqHPWiCBGZWxrmYBkF:matrix.parity.io'
pre-release: false
- name: "RelEng: Polkadot Release Coordination"
room: '!cqAmzdIcbOFwrdrubV:parity.io'
pre-release: true
- name: 'Ledger <> Polkadot Coordination'
room: '!EoIhaKfGPmFOBrNSHT:web3.foundation'
pre-release: true
- name: 'General: Rust, Polkadot, Substrate'
room: '!aJymqQYtCjjqImFLSb:parity.io'
pre-release: false
- name: 'Team: DevOps'
room: '!lUslSijLMgNcEKcAiE:parity.io'
pre-release: true

runs-on: ubuntu-latest
steps:
- name: Send Matrix message to ${{ matrix.channel.name }}
if: github.event.release.prerelease == false || matrix.channel.pre-release
uses: s3krit/[email protected]
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
with:
room_id: ${{ matrix.channel.room }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
server: "m.parity.io"
message: "***Polkadot ${{github.event.release.tag_name}} has been released!***<br/>${{github.event.release.html_url}}<br/><br/>${{github.event.release.body}}<br/>"
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
***Polkadot ${{github.event.release.tag_name}} has been released!***<br/>
${{github.event.release.html_url}}<br/><br/>
${{github.event.release.body}}<br/>
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ polkadot.*
!polkadot.service
.DS_Store
.env

artifacts
release-artifacts
release.json
42 changes: 25 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 100
CI_SERVER_NAME: "GitLab CI"
CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.29"
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.55"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.65"

default:
cache: {}
Expand Down Expand Up @@ -159,31 +159,39 @@ default:
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1

.build-push-image:
variables:
CI_IMAGE: "${BUILDAH_IMAGE}"

REGISTRY: "docker.io"
DOCKER_OWNER: "paritypr"
DOCKER_USER: "${PARITYPR_USER}"
DOCKER_PASS: "${PARITYPR_PASS}"
IMAGE: "${REGISTRY}/${DOCKER_OWNER}/${IMAGE_NAME}"

ENGINE: "${BUILDAH_COMMAND}"
BUILDAH_FORMAT: "docker"
SKIP_IMAGE_VALIDATION: 1

PROJECT_ROOT: "."
BIN_FOLDER: "./artifacts"
VCS_REF: "${CI_COMMIT_SHA}"

before_script:
- !reference [.common-before-script, before_script]
- test -s ./artifacts/VERSION || exit 1
- test -s ./artifacts/EXTRATAG || exit 1
- VERSION="$(cat ./artifacts/VERSION)"
- export VERSION="$(cat ./artifacts/VERSION)"
- EXTRATAG="$(cat ./artifacts/EXTRATAG)"
- echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
script:
- test "$DOCKER_USER" -a "$DOCKER_PASS" ||
( echo "no docker credentials provided"; exit 1 )
- cd ./artifacts
- $BUILDAH_COMMAND build
--format=docker
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--build-arg IMAGE_NAME="${IMAGE_NAME}"
--tag "$IMAGE_NAME:$VERSION"
--tag "$IMAGE_NAME:$EXTRATAG"
--file ${DOCKERFILE} .
# The job will success only on the protected branch
- TAGS="${VERSION},${EXTRATAG}" scripts/ci/dockerfiles/build-injected.sh
- echo "$DOCKER_PASS" |
buildah login --username "$DOCKER_USER" --password-stdin docker.io
buildah login --username "$DOCKER_USER" --password-stdin "${REGISTRY}"
- $BUILDAH_COMMAND info
- $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$VERSION"
- $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
- $BUILDAH_COMMAND push --format=v2s2 "$IMAGE:$VERSION"
- $BUILDAH_COMMAND push --format=v2s2 "$IMAGE:$EXTRATAG"
after_script:
- buildah logout --all

Expand Down Expand Up @@ -225,7 +233,7 @@ include:
file: /common/timestamp.yml
- project: parity/infrastructure/ci_cd/shared
ref: main
file: /common/ci-unified.yml
file: /common/ci-unified.yml


#### stage: .post
Expand Down
Loading

0 comments on commit 4f9dfa8

Please sign in to comment.