Skip to content

Commit ea55e03

Browse files
Block scripts and GHA required to publish to platforma-open (#7)
* add scripts and github workflow files needed for publishing * Do not run template workflow jobs in boilerplate repo
1 parent 09aa80e commit ea55e03

File tree

6 files changed

+117
-5
lines changed

6 files changed

+117
-5
lines changed

.github/workflows/build.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build, Test and Release Platforma Block
2+
on:
3+
merge_group:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
branches:
7+
- 'main'
8+
push:
9+
branches:
10+
- 'main'
11+
workflow_dispatch: {}
12+
jobs:
13+
init:
14+
if: github.repository != 'milaboratory/platforma-block-boilerplate'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: milaboratory/github-ci/actions/context/init@v4
18+
with:
19+
version-canonize: false
20+
branch-versioning: main
21+
run:
22+
if: github.repository != 'milaboratory/platforma-block-boilerplate'
23+
needs:
24+
- init
25+
uses: milaboratory/github-ci/.github/workflows/node-simple-pnpm.yaml@v4
26+
with:
27+
app-name: 'Block: block-boilerplate'
28+
app-name-slug: 'block-block-boilerplate'
29+
notify-telegram: true
30+
node-version: '20.x'
31+
build-script-name: 'build'
32+
pnpm-recursive-build: false
33+
test: false
34+
test-script-name: 'test'
35+
pnpm-recursive-tests: false
36+
team-id: 'ciplopen'
37+
38+
publish-to-public: 'true'
39+
package-path: 'block'
40+
create-tag: 'true'
41+
42+
npmrc-config: |
43+
{
44+
"registries": {
45+
"https://registry.npmjs.org/": {
46+
"scopes": ["milaboratories", "platforma-sdk", "platforma-open"],
47+
"tokenVar": "NPMJS_TOKEN"
48+
}
49+
}
50+
}
51+
secrets:
52+
env: |
53+
{ "PL_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }},
54+
"MI_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }},
55+
"NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }},
56+
"PL_CI_TEST_USER": ${{ toJSON(secrets.PL_CI_TEST_USER) }},
57+
"PL_CI_TEST_PASSWORD": ${{ toJSON(secrets.PL_CI_TEST_PASSWORD) }},
58+
59+
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }},
60+
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_US_S3_BUCKET) }},
61+
"PL_REGISTRY_PLATFORMA_OPEN_UPLOAD_URL": ${{ toJSON(secrets.PL_REGISTRY_PLOPEN_UPLOAD_URL) }} }
62+
63+
TELEGRAM_NOTIFICATION_TARGET: ${{ secrets.TG_CHANNEL_MIBUILDS }}
64+
TELEGRAM_API_TOKEN: ${{ secrets.TG_CI_BOT_TOKEN }}
65+
66+
GH_ZEN_APP_ID: ${{ secrets.GH_ZEN_APP_ID }}
67+
GH_ZEN_APP_PRIVATE_KEY: ${{ secrets.GH_ZEN_APP_PRIVATE_KEY }}

.github/workflows/mark-stable.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Mark Platforma Block as Stable
2+
on:
3+
workflow_dispatch: {}
4+
jobs:
5+
init:
6+
if: github.repository != 'milaboratory/platforma-block-boilerplate'
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: milaboratory/github-ci/actions/context/init@v4
10+
with:
11+
version-canonize: false
12+
branch-versioning: main
13+
run:
14+
if: github.repository != 'milaboratory/platforma-block-boilerplate'
15+
needs:
16+
- init
17+
uses: milaboratory/github-ci/.github/workflows/block-mark-stable.yaml@v4
18+
with:
19+
app-name: 'Block: block-boilerplate - Mark Stable'
20+
notify-telegram: true
21+
node-version: '20.x'
22+
npmrc-config: |
23+
{
24+
"registries": {
25+
"https://registry.npmjs.org/": {
26+
"scopes": ["milaboratories", "platforma-sdk", "platforma-open"],
27+
"tokenVar": "NPMJS_TOKEN"
28+
}
29+
}
30+
}
31+
secrets:
32+
env: |
33+
{ "NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }},
34+
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }} }
35+
36+
TELEGRAM_NOTIFICATION_TARGET: ${{ secrets.TG_CHANNEL_MIBUILDS }}
37+
TELEGRAM_API_TOKEN: ${{ secrets.TG_CI_BOT_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ log/
99
vite.config.*.timestamp-*
1010
software/**/*.sw.json
1111
software/*.tgz
12-
.DS_Store
12+
.DS_Store
13+
.vscode/sftp.json

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
"build": "turbo run build",
77
"build:dev": "env PL_PKG_DEV=local turbo run build",
88
"test": "env PL_PKG_DEV=local turbo run test --concurrency 1 --env-mode=loose",
9+
"mark-stable": "turbo run mark-stable",
910
"watch": "turbo watch build",
10-
"lint": "pnpm -r lint",
11+
"changeset": "changeset",
12+
"version-packages": "changeset version",
1113
"update-sdk": "node scripts/update-sdk-packages.js"
1214
},
1315
"files": [

software/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"type": "module",
55
"description": "Block Software",
66
"scripts": {
7+
"do-pack": "rm -f *.tgz && pl-pkg build && pnpm pack && mv platforma-open*.tgz package.tgz",
8+
"changeset": "changeset",
9+
"version-packages": "changeset version",
710
"build": "pl-pkg build",
8-
"test": "true",
9-
1011
"prepublishOnly": "pl-pkg publish packages"
1112
},
1213
"block-software": {

turbo.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build": {
66
"inputs": ["$TURBO_DEFAULT$"],
77
"env": ["PL_PKG_DEV"],
8-
"outputs": ["./dist/**"],
8+
"outputs": ["./dist/**", "./block-pack/**", "./pkg-*.tgz"],
99
"dependsOn": ["^build"]
1010
},
1111
"build:dev": {
@@ -15,6 +15,10 @@
1515
"test": {
1616
"dependsOn": ["^build:dev", "build"],
1717
"passThroughEnv": ["PL_ADDRESS", "PL_TEST_PASSWORD", "PL_TEST_USER", "PL_TEST_PROXY", "DEBUG"]
18+
},
19+
"mark-stable": {
20+
"passThroughEnv": ["PL_REGISTRY", "AWS_*"],
21+
"cache": false
1822
}
1923
}
2024
}

0 commit comments

Comments
 (0)