Skip to content

Commit

Permalink
Update release process (#1)
Browse files Browse the repository at this point in the history
Configure the CI pipeline to trigger on tag creation. Tag new Docker
images with `:latest` and their version number.
  • Loading branch information
fxgst authored Jan 26, 2024
1 parent 1c26d64 commit 8127004
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 15 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#
name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
branches: ['release']
release:
types: [published]

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -25,24 +23,26 @@ jobs:
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.description=A canister development environment for the Internet Computer (ICP).
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
** @dfinity/testing-verification
** @dfinity/testing-verification @dfinity/sdk
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM --platform=linux/amd64 rust:1.75-slim-bookworm

RUN apt -yq update
RUN apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git

ENV NVM_DIR=/root/.nvm
ENV NVM_VERSION=v0.39.7
ENV NODE_VERSION=21.5.0
ENV DFX_VERSION=0.16.0
ENV POCKET_IC_SERVER_HASH=69e1408347723dbaa7a6cd2faa9b65c42abbe861
ENV POCKET_IC_PYTHON_VERSION=2.0.2

RUN apt -yq update
RUN apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git python3 python3-pip

# Install Node.js using nvm
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin:${PATH}"
Expand All @@ -17,10 +20,13 @@ RUN . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}
# Install dfx
RUN sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

# Install wasm32-unknown-unknown target
# Add wasm32-unknown-unknown target
RUN rustup target add wasm32-unknown-unknown

# Install PocketIC
RUN curl -sLO https://download.dfinity.systems/ic/69e1408347723dbaa7a6cd2faa9b65c42abbe861/openssl-static-binaries/x86_64-linux/pocket-ic.gz
# Install PocketIC Python
RUN pip3 install pocket-ic==${POCKET_IC_PYTHON_VERSION} --break-system-packages

# Download the PocketIC server
RUN curl -sLO https://download.dfinity.systems/ic/${POCKET_IC_SERVER_HASH}/openssl-static-binaries/x86_64-linux/pocket-ic.gz
RUN gzip -d pocket-ic.gz
RUN chmod +x pocket-ic
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# ICP Developer Environment

This repo contains a Docker image that is used for setting up a remote, hybrid or local development environments for new developers on the IC.

## Usage
This container image can be used as a base for creating a dev container environment that targets ICP development.
Take a look at the repositories below to see dev containers in action:
- [ICP Hello World Motoko](https://github.com/dfinity/icp-hello-world-motoko)
- [ICP Hello World Rust](https://github.com/dfinity/icp-hello-world-rust)

### Packages and Releases
On the right side, you will find new releases and the latest packages.
You can download the Docker image with

```bash
docker pull ghcr.io/dfinity/icp-dev-env:latest
```

or

```bash
docker pull ghcr.io/dfinity/icp-dev-env:<version>
```
for a specific version.

## Creating a new Release
To release a new version, create a new tag with the corresponding version number.
The CI pipeline will automatically build and push the new image to the GitHub Container Registry (ghcr.io).

0 comments on commit 8127004

Please sign in to comment.