diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6ec14ed --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,67 @@ +name: Build, Test and Release Platforma Block +on: + merge_group: + pull_request: + types: [opened, reopened, synchronize] + branches: + - 'main' + push: + branches: + - 'main' + workflow_dispatch: {} +jobs: + init: + if: github.repository != 'milaboratory/platforma-block-boilerplate' + runs-on: ubuntu-latest + steps: + - uses: milaboratory/github-ci/actions/context/init@v4 + with: + version-canonize: false + branch-versioning: main + run: + if: github.repository != 'milaboratory/platforma-block-boilerplate' + needs: + - init + uses: milaboratory/github-ci/.github/workflows/node-simple-pnpm.yaml@v4 + with: + app-name: 'Block: block-boilerplate' + app-name-slug: 'block-block-boilerplate' + notify-telegram: true + node-version: '20.x' + build-script-name: 'build' + pnpm-recursive-build: false + test: false + test-script-name: 'test' + pnpm-recursive-tests: false + team-id: 'ciplopen' + + publish-to-public: 'true' + package-path: 'block' + create-tag: 'true' + + npmrc-config: | + { + "registries": { + "https://registry.npmjs.org/": { + "scopes": ["milaboratories", "platforma-sdk", "platforma-open"], + "tokenVar": "NPMJS_TOKEN" + } + } + } + secrets: + env: | + { "PL_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }}, + "MI_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }}, + "NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }}, + "PL_CI_TEST_USER": ${{ toJSON(secrets.PL_CI_TEST_USER) }}, + "PL_CI_TEST_PASSWORD": ${{ toJSON(secrets.PL_CI_TEST_PASSWORD) }}, + + "AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }}, + "AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_US_S3_BUCKET) }}, + "PL_REGISTRY_PLATFORMA_OPEN_UPLOAD_URL": ${{ toJSON(secrets.PL_REGISTRY_PLOPEN_UPLOAD_URL) }} } + + TELEGRAM_NOTIFICATION_TARGET: ${{ secrets.TG_CHANNEL_MIBUILDS }} + TELEGRAM_API_TOKEN: ${{ secrets.TG_CI_BOT_TOKEN }} + + GH_ZEN_APP_ID: ${{ secrets.GH_ZEN_APP_ID }} + GH_ZEN_APP_PRIVATE_KEY: ${{ secrets.GH_ZEN_APP_PRIVATE_KEY }} diff --git a/.github/workflows/mark-stable.yaml b/.github/workflows/mark-stable.yaml new file mode 100644 index 0000000..aaaf1c3 --- /dev/null +++ b/.github/workflows/mark-stable.yaml @@ -0,0 +1,37 @@ +name: Mark Platforma Block as Stable +on: + workflow_dispatch: {} +jobs: + init: + if: github.repository != 'milaboratory/platforma-block-boilerplate' + runs-on: ubuntu-latest + steps: + - uses: milaboratory/github-ci/actions/context/init@v4 + with: + version-canonize: false + branch-versioning: main + run: + if: github.repository != 'milaboratory/platforma-block-boilerplate' + needs: + - init + uses: milaboratory/github-ci/.github/workflows/block-mark-stable.yaml@v4 + with: + app-name: 'Block: block-boilerplate - Mark Stable' + notify-telegram: true + node-version: '20.x' + npmrc-config: | + { + "registries": { + "https://registry.npmjs.org/": { + "scopes": ["milaboratories", "platforma-sdk", "platforma-open"], + "tokenVar": "NPMJS_TOKEN" + } + } + } + secrets: + env: | + { "NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }}, + "AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }} } + + TELEGRAM_NOTIFICATION_TARGET: ${{ secrets.TG_CHANNEL_MIBUILDS }} + TELEGRAM_API_TOKEN: ${{ secrets.TG_CI_BOT_TOKEN }} diff --git a/.gitignore b/.gitignore index ae70fee..f96a8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ log/ vite.config.*.timestamp-* software/**/*.sw.json software/*.tgz -.DS_Store \ No newline at end of file +.DS_Store +.vscode/sftp.json \ No newline at end of file diff --git a/package.json b/package.json index e4bc742..36cfe9f 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,10 @@ "build": "turbo run build", "build:dev": "env PL_PKG_DEV=local turbo run build", "test": "env PL_PKG_DEV=local turbo run test --concurrency 1 --env-mode=loose", + "mark-stable": "turbo run mark-stable", "watch": "turbo watch build", - "lint": "pnpm -r lint", + "changeset": "changeset", + "version-packages": "changeset version", "update-sdk": "node scripts/update-sdk-packages.js" }, "files": [ diff --git a/software/package.json b/software/package.json index cd02866..acc5628 100644 --- a/software/package.json +++ b/software/package.json @@ -4,9 +4,10 @@ "type": "module", "description": "Block Software", "scripts": { + "do-pack": "rm -f *.tgz && pl-pkg build && pnpm pack && mv platforma-open*.tgz package.tgz", + "changeset": "changeset", + "version-packages": "changeset version", "build": "pl-pkg build", - "test": "true", - "prepublishOnly": "pl-pkg publish packages" }, "block-software": { diff --git a/turbo.json b/turbo.json index a9b80ff..3c3c112 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,7 @@ "build": { "inputs": ["$TURBO_DEFAULT$"], "env": ["PL_PKG_DEV"], - "outputs": ["./dist/**"], + "outputs": ["./dist/**", "./block-pack/**", "./pkg-*.tgz"], "dependsOn": ["^build"] }, "build:dev": { @@ -15,6 +15,10 @@ "test": { "dependsOn": ["^build:dev", "build"], "passThroughEnv": ["PL_ADDRESS", "PL_TEST_PASSWORD", "PL_TEST_USER", "PL_TEST_PROXY", "DEBUG"] + }, + "mark-stable": { + "passThroughEnv": ["PL_REGISTRY", "AWS_*"], + "cache": false } } }