Skip to content

Commit

Permalink
Merge branch 'v1.5-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Nov 1, 2024
2 parents ebe01a0 + 8aa624e commit feacde2
Show file tree
Hide file tree
Showing 930 changed files with 31,216 additions and 13,371 deletions.
59 changes: 59 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Use the official VS Code base image for dev containers
FROM mcr.microsoft.com/devcontainers/base:ubuntu

# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
pkg-config \
clang \
cmake \
llvm \
curl \
gnupg \
lsb-release \
software-properties-common \
unzip

# Switch to clang
RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc

# Install protoc - protobuf compiler
# The one shipped with Alpine does not work
ARG TARGETARCH
ARG PROTOC_VERSION=27.3
RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else export PROTOC_ARCH=x86_64; fi; \
curl -Ls https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip \
-o /tmp/protoc.zip && \
unzip -qd /opt/protoc /tmp/protoc.zip && \
rm /tmp/protoc.zip && \
ln -s /opt/protoc/bin/protoc /usr/bin/

# Install protoc
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip \
&& unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local \
&& rm protoc-${PROTOC_VERSION}-linux-x86_64.zip

# Switch to vscode user
USER vscode

ENV CARGO_HOME=/home/vscode/.cargo
ENV PATH=$CARGO_HOME/bin:$PATH

# TODO: It doesn't sharing PATH between stages, so we need "source $HOME/.cargo/env" everywhere
COPY rust-toolchain.toml .
RUN TOOLCHAIN_VERSION="$(grep channel rust-toolchain.toml | awk '{print $3}' | tr -d '"')" && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--profile minimal \
-y \
--default-toolchain "${TOOLCHAIN_VERSION}" \
--target wasm32-unknown-unknown
# Install wasm-bindgen-cli in the same profile as other components, to sacrifice some performance & disk space to gain
# better build caching
RUN if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
RUSTFLAGS="-C target-feature=-crt-static" \
# Meanwhile if you want to update wasm-bindgen you also need to update version in:
# - packages/wasm-dpp/Cargo.toml
# - packages/wasm-dpp/scripts/build-wasm.sh
cargo install [email protected] --locked
73 changes: 73 additions & 0 deletions .devcontainer/devcontainer-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "Dash Platform Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"arcanis.vscode-zipfs",
"chrmarti.regex",
"davidanson.vscode-markdownlint",
"ms-vscode.cmake-tools",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vadimcn.vscode-lldb",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"zhangyue.rust-mod-generator",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "vscode",
"mounts": [
{
"source": "devcontainer-platform-cargo-registry-index-${devcontainerId}",
"target": "/home/vscode/.cargo/registry",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-registry-cache-${devcontainerId}",
"target": "/home/vscode/.cargo/registry/cache",
"type": "volume"
},
{
"source": "devcontainer-platform-cargo-git-db-${devcontainerId}",
"target": "/home/vscode/.cargo/git/db",
"type": "volume"
},
{
"source": "devcontainer-platform-target-${devcontainerId}",
"target": "${containerWorkspaceFolder}/target",
"type": "volume"
}
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": 20,
"installYarnUsingApt": false
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/schlich/devcontainer-features/starship:0": {},
},
"postCreateCommand": {
"git-safe": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"cargo-permissions": "sudo chown -R vscode:vscode /home/vscode/.cargo ${containerWorkspaceFolder}/target"
}
}
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "Dash Platform Dev Container",
"image": "ghcr.io/dashpay/platform/devcontainer:0.1.0"
}
2 changes: 1 addition & 1 deletion .github/actions/rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ runs:
shell: bash
run: |
curl -Lo /tmp/protoc.zip \
"https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-${{ steps.protoc_arch.outputs.arch }}.zip"
"https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-${{ steps.protoc_arch.outputs.arch }}.zip"
unzip -o /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/prebuild-devcontainers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Prebuild Dev Containers

on:
push:
paths:
- '.devcontainer/**'
- '.github/workflows/prebuild-devcontainers.yml'
- rust-toolchain.toml
- Dockerfile
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and push devcontainer
runs-on: ["self-hosted", "linux", "x64", "ubuntu-platform"]
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install skopeo
run: |
sudo apt-get update
sudo apt-get install -y skopeo
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
use: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: dashpay
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push Platform devcontainer
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/dashpay/platform/devcontainer
imageTag: 0.1.0
platform: linux/amd64,linux/arm64
configFile: .devcontainer/devcontainer-build.json
push: always
cacheFrom: ghcr.io/dashpay/platform/devcontainer
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
- package_type: deb
os: ubuntu-22.04
- package_type: macos
os: macos-12
os: macos-14
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -242,9 +242,11 @@ jobs:
- name: Install macOS build deps
if: runner.os == 'macOS'
run: |
brew install llvm docker colima coreutils
colima start
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
brew install llvm coreutils
- name: Set up Docker for macOS
if: runner.os == 'macOS'
uses: docker-practice/actions-setup-docker@master

- name: Install the Apple certificate
if: runner.os == 'macOS'
Expand Down Expand Up @@ -278,7 +280,7 @@ jobs:

- name: Create package
env:
OSX_KEYCHAIN: $RUNNER_TEMP/app-signing.keychain-db
OSX_KEYCHAIN: ${{ runner.temp }}/app-signing.keychain-db
run: "${GITHUB_WORKSPACE}/scripts/pack_dashmate.sh ${{ matrix.package_type }}"

- name: Upload artifacts to action summary
Expand Down
32 changes: 16 additions & 16 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ npmAuditExcludePackages:
- "@humanwhocodes/config-array" # TODO: Update eslint
- "@humanwhocodes/object-schema" # TODO: Update eslint
- micromatch # TODO: remove when new micromatch will be released https://github.com/advisories/GHSA-952p-6rrq-rcjv
- eslint # TODO: Update eslint https://github.com/dashpay/platform/issues/2212
- elliptic # TODO: Remove when elliptic >6.5.7 released

packageExtensions:
"@dashevo/protobufjs@*":
Expand Down
Loading

0 comments on commit feacde2

Please sign in to comment.