Skip to content

Commit 747aa47

Browse files
authored
feat: prepare release pipeline (#1)
1 parent 748e072 commit 747aa47

Some content is hidden

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

41 files changed

+3932
-154
lines changed

.github/workflows/images-tags.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/images.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- container_name: studio
2626
dockerfile: studio/Dockerfile
2727
context_path: .
28+
- container_name: keycloak
29+
dockerfile: keycloak/Dockerfile
30+
context_path: keycloak
31+
- container_name: otelcollector
32+
dockerfile: otelcollector/Dockerfile
33+
context_path: otelcollector
2834

2935
runs-on: ubuntu-latest
3036
permissions:
@@ -35,7 +41,7 @@ jobs:
3541
- name: Checkout repository
3642
uses: actions/checkout@v3
3743

38-
- name: Log in to the Container registry
44+
- name: Log in to Github Container registry
3945
uses: docker/login-action@v2
4046
with:
4147
registry: ${{ env.REGISTRY }}
@@ -46,11 +52,16 @@ jobs:
4652
id: meta
4753
uses: docker/metadata-action@v4
4854
with:
49-
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}
55+
images: |
56+
${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}
5057
tags: |
5158
type=ref,event=branch
5259
type=ref,event=pr
53-
type=sha,format=long,prefix=sha256-
60+
type=sha
61+
# set latest tag for default branch
62+
type=raw,value=latest,enable={{is_default_branch}}
63+
# use custom value instead of git tag
64+
type=match,pattern=[a-zA-Z-_]+@(.*),group=1
5465
5566
- name: Install Docker Buildx
5667
uses: docker/setup-buildx-action@v2
@@ -63,3 +74,5 @@ jobs:
6374
context: ${{ matrix.context_path }}
6475
tags: ${{ steps.meta.outputs.tags }}
6576
labels: ${{ steps.meta.outputs.labels }}
77+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}:buildcache
78+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}:buildcache,mode=max
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: NPM Packages Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: ${{github.workflow}}-${{github.head_ref}}
8+
cancel-in-progress: false
9+
10+
env:
11+
CI: true
12+
13+
jobs:
14+
stable-version:
15+
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
16+
permissions:
17+
id-token: write
18+
timeout-minutes: 20
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
token: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }}
25+
- uses: ./.github/actions/node
26+
with:
27+
working-directory: ${{ env.WORKING_DIRECTORY }}
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
31+
shell: bash
32+
env:
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
35+
- name: Install
36+
run: pnpm install
37+
38+
- name: Build
39+
run: pnpm build
40+
41+
- name: Publish packages & Create Github Releases
42+
run: |
43+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --global user.name "github-actions[bot]"
45+
pnpm release
46+
env:
47+
GH_TOKEN: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ strict-peer-dependencies=false # If this is enabled, commands will fail if there
22
fetch-retries="10"
33
ignore-workspace-root-check=true
44
dedupe-peer-dependents=false
5+
provenance=true

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ setup-tools:
66
go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go@latest
77
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
88
go install github.com/yannh/kubeconform/cmd/kubeconform@latest
9+
go install github.com/maykonlf/semver-cli/cmd/semver@latest
910

1011
prerequisites: setup-tools
1112
go version
@@ -88,11 +89,11 @@ docker-push-local:
8889
docker compose --file docker-compose.cosmo.yml push
8990

9091
docker-build-minikube: docker-build-local
91-
minikube image load us-docker.pkg.dev/wg-cosmo/cloud/studio:latest & \
92-
minikube image load us-docker.pkg.dev/wg-cosmo/cloud/controlplane:latest & \
93-
minikube image load us-docker.pkg.dev/wg-cosmo/cosmo/otelcollector:latest & \
94-
minikube image load us-docker.pkg.dev/wg-cosmo/cloud/router:latest & \
95-
minikube image load us-docker.pkg.dev/wg-cosmo/cosmo/otelcollector:latest
92+
minikube image load ghcr.io/wundergraph/cosmo/studio:latest & \
93+
minikube image load ghcr.io/wundergraph/cosmo/controlplane:latest & \
94+
minikube image load ghcr.io/wundergraph/cosmo/otelcollector:latest & \
95+
minikube image load ghcr.io/wundergraph/cosmo/router:latest & \
96+
minikube image load ghcr.io/wundergraph/cosmo/keycloak:latest
9697
minikube cache reload
9798

9899
new-ch-migration:
@@ -111,4 +112,4 @@ migrate-ch-dump:
111112
dbmate -d "./controlplane/clickhouse/migrations" -s "./controlplane/db/schema.sql" -e CLICKHOUSE_DSN dump
112113

113114
build-kc-theme:
114-
(cd keycloak/theme && npm i && ./build.sh)
115+
(cd keycloak/theme && npm i && ./build.sh)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ _Clean up all containers and volumes by running `make full-demo-down`._
6868
- [NodeJS 18+](https://nodejs.org/en/download/)
6969
- [PNPM 8+](https://pnpm.io/installation)
7070
- [Go 1.20+](https://golang.org/doc/install)
71-
- [Java 17 SDK](https://www.oracle.com/java/technologies/downloads/#java17)
7271

7372
Bootstrapping your development environment is easy. Just run the following commands in order:
7473

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wgc",
3-
"version": "0.0.1",
3+
"version": "0.0.0",
44
"description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
55
"type": "module",
66
"main": "dist/index.js",

composition/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
"scripts": {
1313
"dev": "tsc --watch",
1414
"build": "del dist && tsc",
15-
"prepublish": "pnpm run build && pnpm run test",
16-
"release": "pnpm publish --access restricted --tag latest",
1715
"test": "vitest test"
1816
},
1917
"main": "./dist/index.js",

controlplane/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "cosmo-controlplane",
2+
"name": "controlplane",
3+
"version": "0.0.0",
34
"private": true,
4-
"version": "0.1.0",
5-
"description": "",
5+
"description": "WunderGraph Cosmo Controlplane",
66
"type": "module",
77
"main": "dist/index.js",
88
"author": {

controlplane/src/core/test-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
22
import postgres from 'postgres';
33
import nuid from 'nuid';
44
import { drizzle } from 'drizzle-orm/postgres-js';
5-
import { ExpiresAt } from 'node_modules/@wundergraph/cosmo-connect/dist/platform/v1/platform_pb.js';
5+
import { ExpiresAt } from '@wundergraph/cosmo-connect/dist/platform/v1/platform_pb';
66
import { Label, UserAuthContext } from '../types/index.js';
77
import * as schema from '../db/schema.js';
88
import { Authenticator } from './services/Authentication.js';

0 commit comments

Comments
 (0)