-
Notifications
You must be signed in to change notification settings - Fork 12.6k
chore: new release action #341
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| ARG BRANCH='latest' | ||
| ARG CLI_DIR | ||
| ARG BUILD_PATH=cmd/cli | ||
| ARG GO_BIN_DIR | ||
| ARG BUILD_LOCAL=False | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # downloads git and clones selected version | ||
| RUN apk add --no-cache git ca-certificates alpine-sdk | ||
| WORKDIR /go/src/github.com/canopy-network/canopy | ||
| RUN echo "Building from BRANCH=${BRANCH}" && \ | ||
| if [ "$BRANCH" = "latest" ]; then \ | ||
| echo "Fetching latest tag..."; \ | ||
| git clone https://github.com/canopy-network/canopy.git . && \ | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
| echo "Checking out tag $LATEST_TAG" && \ | ||
| git checkout $LATEST_TAG; \ | ||
| else \ | ||
| echo "Cloning branch $BRANCH" && \ | ||
| git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \ | ||
| fi | ||
| # copy golang | ||
| COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/ | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
|
||
| RUN go version | ||
| # Builds | ||
| RUN apk update && apk add --no-cache make bash nodejs npm | ||
| RUN make build/wallet | ||
| RUN make build/explorer | ||
|
|
||
| # Builds auto-update CLI | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/. | ||
|
|
||
| # Only build if the file at ${BIN_PATH} doesn't already exist | ||
| RUN if [ ! -f "${BIN_PATH}" ]; then \ | ||
| echo "File ${BIN_PATH} not found. Building it..."; \ | ||
| CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/...; \ | ||
| else \ | ||
| echo "File ${BIN_PATH} already exists. Skipping build."; \ | ||
| fi | ||
|
|
||
| FROM alpine:3.19 | ||
pablocampogo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| WORKDIR /app | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Coying for command | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy | ||
| # Copying cli for auto update | ||
| COPY --from=builder ${BIN_PATH} ${BIN_PATH} | ||
| # Copying entrypoint for persisting update cli | ||
| COPY entrypoint.sh /app/entrypoint.sh | ||
|
|
||
| RUN apk add --no-cache pigz ca-certificates | ||
|
|
||
| RUN chmod +x ${BIN_PATH} | ||
| RUN chmod +x /app/canopy | ||
| RUN chmod +x /app/entrypoint.sh | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| ARG BRANCH='latest' | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache git ca-certificates alpine-sdk | ||
|
|
||
| WORKDIR /go/src/github.com/canopy-network/canopy | ||
|
|
||
| # Clone repository | ||
| RUN echo "Building from BRANCH=${BRANCH}" && \ | ||
| if [ "$BRANCH" = "latest" ]; then \ | ||
| echo "Fetching latest tag..."; \ | ||
| git clone https://github.com/canopy-network/canopy.git . && \ | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
| echo "Checking out tag $LATEST_TAG" && \ | ||
| git checkout $LATEST_TAG; \ | ||
| else \ | ||
| echo "Cloning branch $BRANCH" && \ | ||
| git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \ | ||
| fi | ||
|
|
||
| # Copy golang | ||
| COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/ | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
|
||
| RUN go version | ||
|
|
||
| # Install build tools | ||
| RUN apk update && apk add --no-cache make bash nodejs npm | ||
|
|
||
| # Build wallet and explorer | ||
| RUN make build/wallet | ||
| RUN make build/explorer | ||
|
|
||
| # Build auto-update coordinator | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/. | ||
|
|
||
| # Build CLI | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/... | ||
|
|
||
| # ============================================================================= | ||
| # Final image for C# plugin | ||
| # ============================================================================= | ||
| # Using Alpine base since C# plugin is now self-contained (includes .NET runtime) | ||
| FROM alpine:3.19 | ||
| WORKDIR /app | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install runtime dependencies | ||
| # - bash: required for pluginctl.sh scripts | ||
| # - procps: provides pkill for plugin process cleanup | ||
| # - ca-certificates: for HTTPS requests to GitHub API | ||
| # - pigz: for fast tarball extraction | ||
| # - libstdc++, libgcc, icu-libs: required by .NET self-contained apps on Alpine | ||
| RUN apk add --no-cache bash procps ca-certificates pigz libstdc++ libgcc icu-libs | ||
|
|
||
| # Copy auto-update coordinator binary | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy | ||
|
|
||
| # Copy CLI binary | ||
| COPY --from=builder ${BIN_PATH} ${BIN_PATH} | ||
|
|
||
| # Create plugin directory and copy only pluginctl.sh | ||
| # Self-contained plugin binary will be downloaded from upstream release and extracted on first start | ||
| RUN mkdir -p /app/plugin/csharp/bin | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/csharp/pluginctl.sh /app/plugin/csharp/pluginctl.sh | ||
|
|
||
| # Copy entrypoint | ||
| COPY entrypoint.sh /app/entrypoint.sh | ||
|
|
||
| # Set permissions | ||
| RUN chmod +x ${BIN_PATH} && \ | ||
| chmod +x /app/canopy && \ | ||
| chmod +x /app/entrypoint.sh && \ | ||
| chmod +x /app/plugin/csharp/pluginctl.sh | ||
|
|
||
| # Create plugin temp directory | ||
| RUN mkdir -p /tmp/plugin | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| ARG BRANCH='latest' | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache git ca-certificates alpine-sdk | ||
|
|
||
| WORKDIR /go/src/github.com/canopy-network/canopy | ||
|
|
||
| # Clone repository | ||
| RUN echo "Building from BRANCH=${BRANCH}" && \ | ||
| if [ "$BRANCH" = "latest" ]; then \ | ||
| echo "Fetching latest tag..."; \ | ||
| git clone https://github.com/canopy-network/canopy.git . && \ | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
| echo "Checking out tag $LATEST_TAG" && \ | ||
| git checkout $LATEST_TAG; \ | ||
| else \ | ||
| echo "Cloning branch $BRANCH" && \ | ||
| git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \ | ||
| fi | ||
|
|
||
| # Copy golang | ||
| COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/ | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
|
||
| RUN go version | ||
|
|
||
| # Install build tools | ||
| RUN apk update && apk add --no-cache make bash nodejs npm | ||
|
|
||
| # Build wallet and explorer | ||
| RUN make build/wallet | ||
| RUN make build/explorer | ||
|
|
||
| # Build auto-update coordinator | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/. | ||
|
|
||
| # Build CLI | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/... | ||
|
|
||
| # ============================================================================= | ||
| # Final image for Go plugin | ||
| # ============================================================================= | ||
| FROM alpine:3.19 | ||
| WORKDIR /app | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install runtime dependencies | ||
| # - bash: required for pluginctl.sh scripts | ||
| # - procps: provides pkill for plugin process cleanup | ||
| # - ca-certificates: for HTTPS requests to GitHub API | ||
| # - pigz: for fast tarball extraction | ||
| RUN apk add --no-cache bash procps ca-certificates pigz | ||
|
|
||
| # Copy auto-update coordinator binary | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy | ||
|
|
||
| # Copy CLI binary | ||
| COPY --from=builder ${BIN_PATH} ${BIN_PATH} | ||
|
|
||
| # Create plugin directory and copy only pluginctl.sh | ||
| # Plugin binary will be downloaded from upstream release and extracted on first start | ||
| RUN mkdir -p /app/plugin/go | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/go/pluginctl.sh /app/plugin/go/pluginctl.sh | ||
|
|
||
| # Copy entrypoint | ||
| COPY entrypoint.sh /app/entrypoint.sh | ||
|
|
||
| # Set permissions | ||
| RUN chmod +x ${BIN_PATH} && \ | ||
| chmod +x /app/canopy && \ | ||
| chmod +x /app/entrypoint.sh && \ | ||
| chmod +x /app/plugin/go/pluginctl.sh | ||
|
|
||
| # Create plugin temp directory | ||
| RUN mkdir -p /tmp/plugin | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| ARG BRANCH='latest' | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache git ca-certificates alpine-sdk | ||
|
|
||
| WORKDIR /go/src/github.com/canopy-network/canopy | ||
|
|
||
| # Clone repository | ||
| RUN echo "Building from BRANCH=${BRANCH}" && \ | ||
| if [ "$BRANCH" = "latest" ]; then \ | ||
| echo "Fetching latest tag..."; \ | ||
| git clone https://github.com/canopy-network/canopy.git . && \ | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
| echo "Checking out tag $LATEST_TAG" && \ | ||
| git checkout $LATEST_TAG; \ | ||
| else \ | ||
| echo "Cloning branch $BRANCH" && \ | ||
| git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \ | ||
| fi | ||
|
|
||
| # Copy golang | ||
| COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/ | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
|
||
| RUN go version | ||
|
|
||
| # Install build tools | ||
| RUN apk update && apk add --no-cache make bash nodejs npm | ||
|
|
||
| # Build wallet and explorer | ||
| RUN make build/wallet | ||
| RUN make build/explorer | ||
|
|
||
| # Build auto-update coordinator | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/. | ||
|
|
||
| # Build CLI | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/... | ||
|
|
||
| # ============================================================================= | ||
| # Final image for Kotlin plugin | ||
| # ============================================================================= | ||
| FROM alpine:3.19 | ||
| WORKDIR /app | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install runtime dependencies | ||
| # - bash: required for pluginctl.sh scripts | ||
| # - openjdk21-jre: Java runtime for Kotlin plugin | ||
| # - procps: provides pkill for plugin process cleanup | ||
| # - ca-certificates: for HTTPS requests to GitHub API | ||
| # - pigz: for fast tarball extraction | ||
| RUN apk add --no-cache bash openjdk21-jre procps ca-certificates pigz | ||
|
|
||
| # Copy auto-update coordinator binary | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy | ||
|
|
||
| # Copy CLI binary | ||
| COPY --from=builder ${BIN_PATH} ${BIN_PATH} | ||
|
|
||
| # Create plugin directory and copy only pluginctl.sh | ||
| # Plugin JAR will be downloaded from upstream release and extracted on first start | ||
| RUN mkdir -p /app/plugin/kotlin/build/libs | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/kotlin/pluginctl.sh /app/plugin/kotlin/pluginctl.sh | ||
|
|
||
| # Copy entrypoint | ||
| COPY entrypoint.sh /app/entrypoint.sh | ||
|
|
||
| # Set permissions | ||
| RUN chmod +x ${BIN_PATH} && \ | ||
| chmod +x /app/canopy && \ | ||
| chmod +x /app/entrypoint.sh && \ | ||
| chmod +x /app/plugin/kotlin/pluginctl.sh | ||
|
|
||
| # Create plugin temp directory | ||
| RUN mkdir -p /tmp/plugin | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| ARG BRANCH='latest' | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache git ca-certificates alpine-sdk | ||
|
|
||
| WORKDIR /go/src/github.com/canopy-network/canopy | ||
|
|
||
| # Clone repository | ||
| RUN echo "Building from BRANCH=${BRANCH}" && \ | ||
| if [ "$BRANCH" = "latest" ]; then \ | ||
| echo "Fetching latest tag..."; \ | ||
| git clone https://github.com/canopy-network/canopy.git . && \ | ||
| LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
| echo "Checking out tag $LATEST_TAG" && \ | ||
| git checkout $LATEST_TAG; \ | ||
| else \ | ||
| echo "Cloning branch $BRANCH" && \ | ||
| git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \ | ||
| fi | ||
|
|
||
| # Copy golang | ||
| COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/ | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
|
||
| RUN go version | ||
|
|
||
| # Install build tools | ||
| RUN apk update && apk add --no-cache make bash nodejs npm | ||
|
|
||
| # Build wallet and explorer | ||
| RUN make build/wallet | ||
| RUN make build/explorer | ||
|
|
||
| # Build auto-update coordinator | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/. | ||
|
|
||
| # Build CLI | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/... | ||
|
|
||
| # ============================================================================= | ||
| # Final image for Python plugin | ||
| # ============================================================================= | ||
| FROM alpine:3.19 | ||
| WORKDIR /app | ||
| ARG BIN_PATH=/bin/cli | ||
|
|
||
| # Install runtime dependencies | ||
| # - bash: required for pluginctl.sh scripts | ||
| # - python3, py3-pip, py3-setuptools: Python runtime for plugin and venv creation | ||
| # - procps: provides pkill for plugin process cleanup | ||
| # - ca-certificates: for HTTPS requests to GitHub API | ||
| # - pigz: for fast tarball extraction | ||
| RUN apk add --no-cache bash python3 py3-pip py3-setuptools procps ca-certificates pigz | ||
|
|
||
| # Copy auto-update coordinator binary | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy | ||
|
|
||
| # Copy CLI binary | ||
| COPY --from=builder ${BIN_PATH} ${BIN_PATH} | ||
|
|
||
| # Create plugin directory and copy only pluginctl.sh | ||
| # Plugin source will be downloaded from upstream release and extracted on first start | ||
| RUN mkdir -p /app/plugin/python | ||
| COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/python/pluginctl.sh /app/plugin/python/pluginctl.sh | ||
|
|
||
| # Copy entrypoint | ||
| COPY entrypoint.sh /app/entrypoint.sh | ||
|
|
||
| # Set permissions | ||
| RUN chmod +x ${BIN_PATH} && \ | ||
| chmod +x /app/canopy && \ | ||
| chmod +x /app/entrypoint.sh && \ | ||
| chmod +x /app/plugin/python/pluginctl.sh | ||
|
|
||
| # Create plugin temp directory | ||
| RUN mkdir -p /tmp/plugin | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.