diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index e57fa8d5c..43b2691e4 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -2,7 +2,10 @@ name: Dockerize on: push: - branches: [master] + branches: + - master + tags: + - v*.*.* concurrency: group: dockerize-${{ github.ref }} @@ -14,6 +17,17 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/logto-io/logto + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -29,7 +43,8 @@ jobs: with: context: . push: true - tags: ghcr.io/logto-io/logto:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - name: Compose up run: docker compose up -d diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..c65759f8d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + semver: + description: Semver bump type + required: true + preid: + description: Pre ID + required: true + default: alpha + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.BOT_PAT }} + + - name: Setup Node and pnpm + uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.2 + + - name: Configure Git user + run: | + git config --global user.email bot@silverhand.io + git config --global user.name silverhand-bot + + - name: Publish to GitHub + # add `no-verify-access` due to https://github.com/lerna/lerna/issues/2788 + run: | + pnpm -- lerna publish -m "release: %s" --conventional-commits --preid=${{ github.event.inputs.preid }} --no-verify-access --create-release=github --yes ${{ github.event.inputs.semver }} + env: + GH_TOKEN: ${{ secrets.BOT_PAT }} + + - name: Package + run: ./package.sh + + - name: Upload tar to GitHub release + uses: softprops/action-gh-release@v1 + with: + files: /tmp/logto.tar.gz diff --git a/packages/connector-alipay-native/package.json b/packages/connector-alipay-native/package.json index 97d7d6af4..5a02ad037 100644 --- a/packages/connector-alipay-native/package.json +++ b/packages/connector-alipay-native/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-alipay/package.json b/packages/connector-alipay/package.json index 04dcfa5d5..c5c1f2448 100644 --- a/packages/connector-alipay/package.json +++ b/packages/connector-alipay/package.json @@ -6,13 +6,13 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", "logo.svg", "README.md" ], - "private": false, "scripts": { "precommit": "lint-staged", "build": "rm -rf lib/ && tsc -p tsconfig.build.json", diff --git a/packages/connector-aliyun-dm/package.json b/packages/connector-aliyun-dm/package.json index c2f9b5bf8..6cce90b58 100644 --- a/packages/connector-aliyun-dm/package.json +++ b/packages/connector-aliyun-dm/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-aliyun-sms/package.json b/packages/connector-aliyun-sms/package.json index 1021de0d5..f2eee4a9e 100644 --- a/packages/connector-aliyun-sms/package.json +++ b/packages/connector-aliyun-sms/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-apple/package.json b/packages/connector-apple/package.json index 90974ab06..d06e2ba38 100644 --- a/packages/connector-apple/package.json +++ b/packages/connector-apple/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-facebook/package.json b/packages/connector-facebook/package.json index 739c8e041..0103311e0 100644 --- a/packages/connector-facebook/package.json +++ b/packages/connector-facebook/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-github/package.json b/packages/connector-github/package.json index 343016202..231c71bd5 100644 --- a/packages/connector-github/package.json +++ b/packages/connector-github/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-google/package.json b/packages/connector-google/package.json index a13beb7ff..dee489d4d 100644 --- a/packages/connector-google/package.json +++ b/packages/connector-google/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-sendgrid-mail/package.json b/packages/connector-sendgrid-mail/package.json index 8aa8c9f06..7ad2374c5 100644 --- a/packages/connector-sendgrid-mail/package.json +++ b/packages/connector-sendgrid-mail/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-smtp/package.json b/packages/connector-smtp/package.json index d640d09e0..29132aabf 100644 --- a/packages/connector-smtp/package.json +++ b/packages/connector-smtp/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-twilio-sms/package.json b/packages/connector-twilio-sms/package.json index 7307446c9..b684f06b2 100644 --- a/packages/connector-twilio-sms/package.json +++ b/packages/connector-twilio-sms/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-types/package.json b/packages/connector-types/package.json index f815701ad..a5f5b276b 100644 --- a/packages/connector-types/package.json +++ b/packages/connector-types/package.json @@ -4,6 +4,7 @@ "main": "lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib" ], diff --git a/packages/connector-wechat-native/package.json b/packages/connector-wechat-native/package.json index b37d7ce0c..d01c59d16 100644 --- a/packages/connector-wechat-native/package.json +++ b/packages/connector-wechat-native/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/connector-wechat/package.json b/packages/connector-wechat/package.json index 071fa35f7..afcf04cf5 100644 --- a/packages/connector-wechat/package.json +++ b/packages/connector-wechat/package.json @@ -6,6 +6,7 @@ "exports": "./lib/index.js", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "files": [ "lib", "docs", diff --git a/packages/console/package.json b/packages/console/package.json index 1d9c14340..f4df028c9 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -5,6 +5,7 @@ "author": "Silverhand Inc. ", "homepage": "https://github.com/logto-io/logto#readme", "license": "MPL-2.0", + "private": true, "scripts": { "precommit": "lint-staged", "start": "parcel src/index.html", diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index c21c4171f..c5856ba1d 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -4,8 +4,10 @@ "description": "Logto demo app.", "author": "Silverhand Inc. ", "license": "MPL-2.0", + "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", + "version": "pnpm i --frozen-lockfile=false", "precommit": "lint-staged", "start": "parcel src/index.html", "dev": "cross-env PORT=5003 parcel src/index.html --public-url /demo-app --no-cache --hmr-port 6003",