Skip to content

Commit

Permalink
Merge branch 'master' into shazarre/explictly_invalid_package_version
Browse files Browse the repository at this point in the history
  • Loading branch information
shazarre authored Dec 15, 2023
2 parents c0df87b + 3a7135c commit 9090105
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/celo-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
code-${{ github.sha }}
- name: Detect files changed in PR (or commit), and expose as output
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v40
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/container-all-monorepo.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/container-celotool.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/container-cli.yml

This file was deleted.

159 changes: 159 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
name: Build containers

on:
push:
paths:
- 'dockerfiles/**'
branches:
- master
pull_request:
paths:
- 'dockerfiles/**'
workflow_dispatch:

jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
# Propagate more outputs if you need https://github.com/tj-actions/changed-files#outputs
# Adding a initial comma so ',<path>' matches also for the first file
all_modified_files: ',${{ steps.changed-files.outputs.all_modified_files }}'
steps:
- uses: actions/checkout@v4
- name: Detect files changed in PR (or commit), and expose as output
id: changed-files
uses: tj-actions/changed-files@v40
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','

# Celotool images
celotool-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:${{ github.sha }}
needs: changed-files
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/celotool/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celotool
tags: ${{ github.sha }}
platforms: linux/amd64
context: .
file: dockerfiles/celotool/Dockerfile
trivy: true
celotool-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:${{ github.sha }}
needs: changed-files
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/celotool/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool
tags: ${{ github.sha }}
platforms: linux/amd64
context: .
file: dockerfiles/celotool/Dockerfile
trivy: true

# All monorepo
celomonorepo-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/monorepo:${{ github.sha }}
needs: changed-files
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/all-monorepo/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/monorepo
tags: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
trivy: true
celomonorepo-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo:${{ github.sha }}
needs: changed-files
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/all-monorepo/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo
tags: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
trivy: true

# CeloCli images
celocli-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celocli:testing
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/cli-standalone/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celocli
tags: testing
context: .
file: dockerfiles/cli-standalone/Dockerfile
trivy: true
celocli-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celocli:latest
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/cli-standalone/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celocli
tags: latest
context: .
file: dockerfiles/cli-standalone/Dockerfile
trivy: true

# Blockscout Metadata crawler images
metadata-crawler-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/blockscout-metadata-crawler:testing
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/blockscout-metadata-crawler
tags: testing
context: .
file: dockerfiles/metadata-crawler/Dockerfile
trivy: true
metadata-crawler-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/blockscout-metadata-crawler/blockscout-metadata-crawler:latest
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/blockscout-metadata-crawler/blockscout-metadata-crawler
tags: latest
context: .
file: dockerfiles/metadata-crawler/Dockerfile
trivy: true
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.codeActionsOnSave": {
"source.organizeImports": false
"source.organizeImports": "never"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": false
"source.organizeImports": "never"
}
},
"[javascriptreact]": {
Expand All @@ -44,5 +44,10 @@
"editor.tabSize": 2,
"editor.detectIndentation": false,
"tslint.jsEnable": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[javascriptreact][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
}
3 changes: 2 additions & 1 deletion dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /celo-monorepo

# Needed for gsutil
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y lsb-release && \
apt-get install -y curl build-essential git python3 && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
Expand Down Expand Up @@ -68,7 +69,7 @@ RUN rm .gitmodules

ENV PATH="/celo-monorepo/packages/celotool/bin:${PATH}"

COPY --from=golang:1.16-stretch /usr/local/go/ /usr/local/go/
COPY --from=golang:1.18-stretch /usr/local/go/ /usr/local/go/

ENV PATH="/usr/local/go/bin:${PATH}"

Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/cli-standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Example build command:
#
# VERSION=x.y.z; docker build . --build-arg VERSION=$VERSION -t gcr.io/celo-testnet/celocli-standalone:$VERSION
FROM node:12-alpine
FROM node:20-alpine
LABEL org.opencontainers.image.authors="[email protected]"

# Install cli install dependencies.
Expand Down
28 changes: 28 additions & 0 deletions dockerfiles/metadata-crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-monorepo

# Monorepo dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y lsb-release && \
apt-get install -y curl build-essential git python3 && \
alias python=python3 && \
rm -rf /var/lib/apt/lists/*

RUN npm install -g typescript npm

COPY lerna.json package.json yarn.lock ./
COPY scripts scripts/
COPY packages/typescript packages/typescript/
COPY packages/sdk packages/sdk/
COPY packages/dev-utils packages/dev-utils/
COPY packages/metadata-crawler packages/metadata-crawler/

RUN yarn install --network-timeout 100000 --frozen-lockfile && \
yarn cache clean && \
yarn build

WORKDIR /celo-monorepo/packages/metadata-crawler
CMD ["node", "lib/crawler.js"]

0 comments on commit 9090105

Please sign in to comment.