Skip to content

Commit 2467666

Browse files
Initial commit
0 parents  commit 2467666

File tree

1,297 files changed

+583213
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,297 files changed

+583213
-0
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
generate-matrix:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
apps: ${{ steps.set-matrix.outputs.apps }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
- id: set-matrix
14+
run: |
15+
apps=$(ls generated | jq -R -s -c 'split("\n")[:-1]')
16+
echo "apps=$apps" >> $GITHUB_OUTPUT
17+
18+
build:
19+
name: Build ${{ matrix.app }}
20+
needs: generate-matrix
21+
strategy:
22+
matrix:
23+
app: ${{ fromJSON(needs.generate-matrix.outputs.apps) }}
24+
uses: spacelift-io/flows-community-registry/.github/workflows/build-app-version.yml@main
25+
with:
26+
working-directory: generated/${{ matrix.app }}
27+
28+
# upload:
29+
# name: Upload artifact
30+
# needs: build
31+
# secrets: inherit
32+
# uses: spacelift-io/flows-core-registry/.github/workflows/upload-app-version.yml@main
33+
34+
# index:
35+
# name: Index app versions
36+
# needs: upload
37+
# secrets: inherit
38+
# uses: spacelift-io/flows-core-registry/.github/workflows/index-app-versions.yml@main

.github/workflows/deploy-app.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Deploy GCP API App
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
app_name:
7+
description: 'Name of the GCP API app to deploy (e.g., "pubsub", "storage")'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
deploy:
13+
name: Deploy GCP API App to R2 (${{ inputs.app_name }})
14+
runs-on: ubuntu-latest
15+
environment: Deployment
16+
defaults:
17+
run:
18+
working-directory: generated/${{ inputs.app_name }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: "npm"
30+
cache-dependency-path: generated/${{ inputs.app_name }}/package-lock.json
31+
32+
- name: Validate app exists
33+
run: |
34+
if [ ! -f "VERSION" ]; then
35+
echo "Error: VERSION file not found"
36+
exit 1
37+
fi
38+
39+
if [ ! -f "package.json" ]; then
40+
echo "Error: package.json not found"
41+
exit 1
42+
fi
43+
44+
- name: Read version from VERSION file
45+
id: version
46+
run: |
47+
VERSION=$(cat VERSION | tr -d '\n')
48+
if [ -z "$VERSION" ]; then
49+
echo "Error: VERSION file is empty"
50+
exit 1
51+
fi
52+
echo "version=$VERSION" >> $GITHUB_OUTPUT
53+
echo "Deploying ${{ inputs.app_name }} version $VERSION"
54+
55+
- name: Install app dependencies
56+
run: npm ci
57+
58+
- name: Bundle app
59+
run: npm run bundle
60+
61+
- name: Create tarball and calculate checksum
62+
id: package
63+
run: |
64+
if [ ! -f "bundle.tar.gz" ]; then
65+
echo "Error: bundle.tar.gz not found after bundling"
66+
exit 1
67+
fi
68+
CHECKSUM=$(sha256sum bundle.tar.gz | cut -d' ' -f1)
69+
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
70+
echo "Bundle checksum: $CHECKSUM"
71+
72+
- name: Upload to R2
73+
env:
74+
AWS_ACCESS_KEY_ID: ${{ secrets.FLOWS_REGISTRY_R2_ACCESS_KEY_ID }}
75+
AWS_SECRET_ACCESS_KEY: ${{ secrets.FLOWS_REGISTRY_R2_SECRET_ACCESS_KEY }}
76+
AWS_DEFAULT_REGION: auto
77+
R2_BUCKET: registry-useflows-com
78+
R2_ENDPOINT_URL: https://5f0d4105431f10a4af1e1f0266f26a97.r2.cloudflarestorage.com
79+
run: |
80+
R2_KEY="gcp-api-${{ inputs.app_name }}"
81+
echo "Uploading to R2 bucket: ${R2_BUCKET}"
82+
echo "R2 key: core/apps/${R2_KEY}/versions/${{ steps.version.outputs.version }}.tar.gz"
83+
84+
aws s3 cp bundle.tar.gz s3://${R2_BUCKET}/core/apps/${R2_KEY}/versions/${{ steps.version.outputs.version }}.tar.gz \
85+
--endpoint-url ${R2_ENDPOINT_URL} \
86+
--metadata sha256=${{ steps.package.outputs.checksum }}
87+
88+
echo "✅ Successfully uploaded ${{ inputs.app_name }} version ${{ steps.version.outputs.version }}"
89+
90+
- name: Index app versions
91+
env:
92+
AWS_ACCESS_KEY_ID: ${{ secrets.FLOWS_REGISTRY_R2_ACCESS_KEY_ID }}
93+
AWS_SECRET_ACCESS_KEY: ${{ secrets.FLOWS_REGISTRY_R2_SECRET_ACCESS_KEY }}
94+
AWS_DEFAULT_REGION: auto
95+
R2_BUCKET: registry-useflows-com
96+
R2_ENDPOINT_URL: https://5f0d4105431f10a4af1e1f0266f26a97.r2.cloudflarestorage.com
97+
run: |
98+
cd ..
99+
mv ${{ inputs.app_name }} gcp-api-${{ inputs.app_name }}
100+
cd gcp-api-${{ inputs.app_name }}
101+
curl -o index-app-versions.cjs https://raw.githubusercontent.com/spacelift-io/flows-core-registry/refs/heads/main/.github/scripts/index-app-versions.cjs
102+
node index-app-versions.cjs

.gitignore

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional stylelint cache
57+
.stylelintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variable files
69+
.env
70+
.env.*
71+
!.env.example
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
out
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and not Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# vuepress v2.x temp and cache directory
95+
.temp
96+
.cache
97+
98+
# Sveltekit cache directory
99+
.svelte-kit/
100+
101+
# vitepress build output
102+
**/.vitepress/dist
103+
104+
# vitepress cache directory
105+
**/.vitepress/cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# Firebase cache directory
120+
.firebase/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v3
129+
.pnp.*
130+
.yarn/*
131+
!.yarn/patches
132+
!.yarn/plugins
133+
!.yarn/releases
134+
!.yarn/sdks
135+
!.yarn/versions
136+
137+
# Vite logs files
138+
vite.config.js.timestamp-*
139+
vite.config.ts.timestamp-*
140+
141+
# Flows app specific
142+
bundle.tar.gz
143+
144+
# Development
145+
.claude/

0 commit comments

Comments
 (0)