Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add gitpod environment #1

Merged
merged 4 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & Push
on:
pull_request:
branches:
- main
- rc*/*
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-*" # Push events to matching v*, i.e. v20.15.10-rc5
env:
registry: docker.io
repository: finschia/cw-gitpod
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: login to the registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
170210 marked this conversation as resolved.
Show resolved Hide resolved
registry: ${{env.registry}}
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: extract metadata for docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.registry}}/${{env.repository}}
tags: |
type=semver,pattern={{version}}
- name: docker build
uses: docker/build-push-action@v5
with:
push: ${{github.event_name != 'pull_request'}}
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}
platforms: linux/amd64
file: .gitpod.Dockerfile
16 changes: 16 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM gitpod/workspace-full@sha256:bb84c4490170fbfdeb577535a6dec5aafd1eb8fdf433f9a344bd8f4a69af5707
ARG FNSA_VERSION=2.0.1

RUN rustup toolchain install 1.69.0
RUN rustup default 1.69.0
RUN rustup target add wasm32-unknown-unknown
RUN rustup default 1.74.1
da1suk8 marked this conversation as resolved.
Show resolved Hide resolved
RUN cargo install cosmwasm-check
RUN cargo install cargo-generate
RUN rustup default 1.69.0
170210 marked this conversation as resolved.
Show resolved Hide resolved

USER root
RUN wget -O /usr/local/bin/fnsad https://github.com/Finschia/finschia/releases/download/v$FNSA_VERSION/fnsad-$FNSA_VERSION-linux-amd64
RUN chmod 755 /usr/local/bin/fnsad

USER gitpod
31 changes: 31 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
image: finschia/cw-gitpod:latest

checkoutLocation: "cw-gitpod"
workspaceLocation: "./cw-gitpod/cosmwasm"

vscode:
extensions:
- rust-lang.rust-analyzer
- Spoorthi.cosmy-wasmy
170210 marked this conversation as resolved.
Show resolved Hide resolved
- tamasfe.even-better-toml

tasks:
- name: Setup

init: |
##
# clone tutorials
cd ..
git clone https://github.com/Finschia/tutorials.git
cd cosmwasm

##
# generate workspace.
cargo generate --git https://github.com/Finschia/cw-workspace.git --name tutorial --init -o

command: |
##
# run localnet and faucet
cd ../tutorials/localnet/single
docker-compose up -d finschia faucet
cd ../../../cosmwasm
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# cw-gitpod
# CW Gitpod

This is an environment for developing Finschia CosmWasm contracts on [Gitpod](https://www.gitpod.io/).

This provides the following environment:

- Install rustc, cargo, cargo-check, cargo-generate, and fnsad in advance
- Run Finschia localnet and the faucet server in advance
- Install rust-analyzer, cosmy-wasmy, and even-better-toml for vscode in advance

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Finschia/cw-gitpod)
Empty file added cosmwasm/.gitkeep
Empty file.
Loading