Skip to content

Commit

Permalink
Dynamic versioning for Polkadot SDK
Browse files Browse the repository at this point in the history
* Use Git Tag to get Polkadot SDK version
* Allows us to build LTS versions without having to update Dockerfile
  • Loading branch information
rblaine95 committed Feb 7, 2025
1 parent 182c94b commit af7f9a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
cache-to: |
type=gha,mode=max,scope=docker-build-${{ matrix.arch }}
context: .
build-args: >-
${{ startsWith(github.ref, 'refs/tags/') && format('VERSION={0}', github.ref_name) || '' }}
package:
needs: [build]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -73,3 +75,5 @@ jobs:
cache-to: |
type=gha,mode=max,scope=docker-package
context: .
build-args: >-
${{ startsWith(github.ref, 'refs/tags/') && format('VERSION={0}', github.ref_name) || '' }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN rustup target add wasm32-unknown-unknown
RUN rustup component add rust-src

WORKDIR /opt
ARG VERSION=polkadot-stable2412-1
RUN git clone https://github.com/paritytech/polkadot-sdk.git -b $VERSION --depth 1
ARG VERSION=stable2412-1
RUN git clone https://github.com/paritytech/polkadot-sdk.git -b polkadot-$VERSION --depth 1
WORKDIR /opt/polkadot-sdk
RUN cargo build --locked --release \
--bin polkadot \
Expand Down

0 comments on commit af7f9a5

Please sign in to comment.