diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index ce889ff1..ecd23366 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -2,11 +2,15 @@ on: push: branches: - main + - experimental pull_request: release: types: - created +env: + BRANCH_TAG: ${{ github.ref_name == 'experimental' && 'experimental' || '' }} + name: build-deploy jobs: check_and_build: @@ -17,7 +21,7 @@ jobs: outputs: dcl_protocol_s3_bucket_key: ${{ steps.publish_dcl_protocol.outputs.s3-bucket-key }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: install run: make install - name: buf build @@ -43,7 +47,10 @@ jobs: ## inform gitlab after publishing to proceed with CDN propagation gitlab-token: ${{ secrets.GITLAB_TOKEN }} gitlab-pipeline-url: ${{ secrets.GITLAB_URL }} + custom-tag: ${{ env.BRANCH_TAG }} + branch-to-custom-tag: ${{ env.BRANCH_TAG }} env: + BRANCH_NAME: ${{ github.ref_name }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} AWS_DEFAULT_REGION: us-east-1 AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} diff --git a/Makefile b/Makefile index 3718d8ac..cba0f90c 100644 --- a/Makefile +++ b/Makefile @@ -24,4 +24,10 @@ all: buf-lint buf-build test install: npm i rm -rf proto/google || true - cp -r node_modules/protobufjs/google proto/google \ No newline at end of file + cp -r node_modules/protobufjs/google proto/google + +list-components-ids: + @bash scripts/list-components-ids.sh + +check-component-id: + @bash scripts/check-component-id.sh $(ID) diff --git a/scripts/check-component-id.sh b/scripts/check-component-id.sh new file mode 100755 index 00000000..e1fcf07b --- /dev/null +++ b/scripts/check-component-id.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: make check-component-id ID=" + exit 1 +fi + +id=$1 + +matches=$(find . -name "*.proto" -exec grep -l "option (common\.ecs_component_id) = $id;" {} +) + +if [ -z "$matches" ]; then + echo "id $id is free" +else + echo "id $id is taken" +fi diff --git a/scripts/list-components-ids.sh b/scripts/list-components-ids.sh new file mode 100755 index 00000000..b6d4fa10 --- /dev/null +++ b/scripts/list-components-ids.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +ids=$(find . -name "*.proto" -exec grep -ho 'option (common\.ecs_component_id) = [0-9]\+;' {} + | sed -E 's/.*= ([0-9]+);/\1/' | sort -n) + +count=$(echo "$ids" | wc -l | xargs) + +echo "List of ids ($count total):" + +i=1 +echo "$ids" | while read id; do + echo "$i. $id" + ((i++)) +done +