diff --git a/.github/workflows/publish-common.yml b/.github/workflows/publish-common.yml index fffc8797..6b7d6cea 100644 --- a/.github/workflows/publish-common.yml +++ b/.github/workflows/publish-common.yml @@ -31,12 +31,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.gh_token }} NPM_REGISTRY_TOKEN: ${{ secrets.npm_registry_token }} + UPLOAD_ASSETS: ${{ inputs.upload_assets }} steps: - name: Checkout uses: actions/checkout@v4 with: show-progress: false fetch-depth: 0 + clean: true ref: ${{ inputs.ref }} - name: Unset header @@ -62,7 +64,7 @@ jobs: run: npm whoami && npx lerna info && npx auto info || echo 'auto info returned 1' - name: Release - run: upload_assets="${{ inputs.upload_assets }}" packages_targets=${{ toJSON(vars.UPLOAD_ASSETS_TARGET_PACKAGES) }} npm run release + run: npm run release - name: Update package-lock files if: ${{ inputs.with-update-package-lock }} diff --git a/.github/workflows/publish-rc-wd.yml b/.github/workflows/publish-rc-wd.yml new file mode 100644 index 00000000..a1bda595 --- /dev/null +++ b/.github/workflows/publish-rc-wd.yml @@ -0,0 +1,17 @@ +name: Publish RC + +on: + workflow_dispatch: + +jobs: + publish: + name: Publish RC version + uses: ./.github/workflows/publish-common.yml + with: + with-update-package-lock: true + commit-message: "Update package-locks files" + auto-options: '--no-changelog' + upload_assets: false + secrets: + gh_token: ${{ secrets.GH_TOKEN }} + npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-rc.yml b/.github/workflows/publish-rc.yml index 1fdb5bd7..036e5728 100644 --- a/.github/workflows/publish-rc.yml +++ b/.github/workflows/publish-rc.yml @@ -6,153 +6,14 @@ on: - dev jobs: - scope: - name: Save state - runs-on: ubuntu-latest - if: ${{ github.actor == 'github-merge-queue[bot]' }} - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - outputs: - HAS_ASSETS: ${{ steps.scope.outputs.result }} - PR: ${{ steps.pr_state.outputs.result }} - steps: - ## Получаем состояние dev branch - - name: Checkout - uses: actions/checkout@v4 - with: - show-progress: false - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - name: Install - run: npm ci --no-audit - - ## Получаем информацию о pull request - - name: One - id: pr_state - uses: actions/github-script@v6 - with: - script: | - const teammate = { - Yakutoc: "alex_czech", - 'neretin-trike': "aaneretin", - 'Yeti-or': "yeti-or", - TitanKuzmich: "aakrivonos", - kayman233: "ivakudryavtsev", - }; - - const res = await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }); - - const { base: { sha = context.sha }, title, user: { login } } = res?.data[0] || {}; - - return { sha, pr: title, user: teammate[login] || 'alex_czech' }; - - - name: Two - id: state - run: | - echo "CHANGED_STATE=$(npx lerna la --json --since=${{ fromJSON(steps.pr_state.outputs.result).sha }} | jq -c)" >> "$GITHUB_OUTPUT" - - - name: Computed scope state - id: scope - uses: actions/github-script@v6 - env: - STATE: ${{ toJSON(steps.state.outputs.CHANGED_STATE) }} - with: - script: | - const { STATE = [] } = process.env || {}; - - if (!STATE.length) { - return false; - } - - const changedState = JSON.parse(JSON.parse(STATE)); - - const packagesList = changedState.map(({ name }) => name); - - return packagesList.includes('plasmax-core') - publish: name: Publish RC version - needs: [scope] uses: ./.github/workflows/publish-common.yml with: with-update-package-lock: true commit-message: "Update package-locks files" auto-options: '--no-changelog' - upload_assets: ${{ needs.scope.outputs.HAS_ASSETS == 'true' }} + upload_assets: false secrets: gh_token: ${{ secrets.GH_TOKEN }} npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }} - - catch: - name: Handle errors - runs-on: ubuntu-latest - needs: [publish, scope] - if: ${{ always() && contains(needs.*.result, 'failure') }} - env: - FAILED_JOB_NAME: ${{ contains(needs.scope.result, 'failure') && 'Save state' || 'Publish RC version' }} - steps: - - name: Get failed job information - id: job - uses: actions/github-script@v6 - env: - RUN_ID: ${{github.run_id}} - FAILED_JOB_NAME: ${{env.FAILED_JOB_NAME}} - with: - script: | - const { RUN_ID, FAILED_JOB_NAME } = process.env; - - const res = await github.rest.actions.listJobsForWorkflowRun({ - run_id: RUN_ID, - owner: context.repo.owner, - repo: context.repo.repo, - }); - - const { data: { jobs: jobsList = [] } } = res || {}; - - const { html_url, steps: stepsList } = jobsList.find(({ name }) => name === FAILED_JOB_NAME) || {}; - - const { name } = stepsList.find(({ conclusion }) => conclusion === "failure" ) || { name: '' }; - - return { targetUrl: html_url, name } - - - name: Create message - if: ${{ success() }} - env: - PR: ${{ fromJSON(needs.scope.outputs.PR).pr }} - USER: ${{ fromJSON(needs.scope.outputs.PR).user }} - FAILURE_STEP: ${{ fromJSON(steps.job.outputs.result).name }} - JOB: ${{ fromJSON(steps.job.outputs.result).targetUrl }} - run: | - step="**Failure step**: ${{ env.FAILURE_STEP }}" - message='@${{ env.USER }}\nПосмотри пожалуйста, упала публикация твоего pull request: [${{ env.PR }}](${{ env.JOB }})' - - echo "NOTIFICATION="$step\\n$message"" >> $GITHUB_ENV - - - name: Create the Mattermost Message - run: | - echo "{\"text\":\"${{env.NOTIFICATION}}\"}" > mattermost.json - - - name: Send notification - uses: mattermost/action-mattermost-notify@master - env: - MATTERMOST_WEBHOOK_URL: ${{ secrets.WEBHOOKS_NOTIFICATIONS_MM }} - - unblock: - needs: [publish] - runs-on: ubuntu-latest - environment: 'After publish rc' - - steps: - - name: Echo - run: | - echo "Publish rc done" diff --git a/auto.config.js b/auto.config.js index 92dc3297..88663579 100644 --- a/auto.config.js +++ b/auto.config.js @@ -18,11 +18,9 @@ const uploadAssetsPluginOptions = { /** Auto configuration */ module.exports = function rc() { - const { upload_assets: uploadAssets = 'false', packages_targets } = process.env || {}; + const { UPLOAD_ASSETS: uploadAssets = 'false', packages_targets } = process.env || {}; const plugins = [['released', releasedOptions], ['npm', npmOptions], 'conventional-commits']; - console.log(packages_targets); - if (uploadAssets === 'true') { plugins.unshift(['./auto-plugins/dist/upload-assets-extend.js', { @@ -33,6 +31,10 @@ module.exports = function rc() { } return { + "labels": [ + { "releaseType": "prerelease", "name": "Prerelease" } + ], + noVersionPrefix: true, prereleaseBranches: ['dev'], plugins, }; diff --git a/lerna.json b/lerna.json index d4559bc2..17e448d6 100644 --- a/lerna.json +++ b/lerna.json @@ -25,6 +25,12 @@ }, "init": { "exact": true + }, + "version": { + "conventionalCommits": true, + "conventionalPrerelease": true, + "conventionalBumpPrerelease": true, + "preid": "dev" } }, "$schema": "node_modules/lerna/schemas/lerna-schema.json" diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 340c326a..4f74a1cd 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "plasmax-core", - "version": "0.59.0", + "version": "0.60.2-dev.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "plasmax-core", - "version": "0.59.0", + "version": "0.60.2-dev.0", "license": "MIT", "devDependencies": { "@types/node": "16.7.13", diff --git a/packages/core/package.json b/packages/core/package.json index c1913b07..f7d45ca7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,8 +1,8 @@ { "name": "plasmax-core", - "version": "0.59.0", + "version": "0.60.2-dev.0", "author": "Alex Czech1 ", - "description": "ddasdasd", + "description": "asdasdas", "license": "MIT", "scripts": { "prepare": "npm run build", diff --git a/packages/hope/package-lock.json b/packages/hope/package-lock.json index 3cb5a37a..efd9d4d4 100644 --- a/packages/hope/package-lock.json +++ b/packages/hope/package-lock.json @@ -1,15 +1,15 @@ { "name": "plasmax-hope", - "version": "0.72.0", + "version": "0.73.2-dev.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "plasmax-hope", - "version": "0.72.0", + "version": "0.73.2-dev.0", "license": "MIT", "dependencies": { - "plasmax-core": "0.59.0" + "plasmax-core": "0.60.2-dev.0" }, "devDependencies": { "@types/node": "16.7.13", @@ -117,9 +117,9 @@ "dev": true }, "node_modules/plasmax-core": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.59.0.tgz", - "integrity": "sha512-ZPEuKNf3wsBLuGaQBM9R/LZMMufSIWa6IuC7M0qJ+sqPzVBZ7d/q7Lv52FhLWwzaqk/w6tExM1ijiuGP3LzVnA==" + "version": "0.60.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.60.2-dev.0.tgz", + "integrity": "sha512-nj4mBmNDfw8Mxdlg22WVWqm/v9OqQY+ScLdeng4sKqbJW4aBxFNmILSQr9wiItWesnoi+4uh0ey07U7lCiDOrA==" }, "node_modules/ts-node": { "version": "10.3.0", @@ -268,9 +268,9 @@ "dev": true }, "plasmax-core": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.59.0.tgz", - "integrity": "sha512-ZPEuKNf3wsBLuGaQBM9R/LZMMufSIWa6IuC7M0qJ+sqPzVBZ7d/q7Lv52FhLWwzaqk/w6tExM1ijiuGP3LzVnA==" + "version": "0.60.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.60.2-dev.0.tgz", + "integrity": "sha512-nj4mBmNDfw8Mxdlg22WVWqm/v9OqQY+ScLdeng4sKqbJW4aBxFNmILSQr9wiItWesnoi+4uh0ey07U7lCiDOrA==" }, "ts-node": { "version": "10.3.0", diff --git a/packages/hope/package.json b/packages/hope/package.json index a411810e..a884c00e 100644 --- a/packages/hope/package.json +++ b/packages/hope/package.json @@ -1,6 +1,6 @@ { "name": "plasmax-hope", - "version": "0.72.0", + "version": "0.73.2-dev.0", "author": "Alex Czech ", "license": "MIT", "description": "33333", @@ -15,7 +15,7 @@ "lint": "eslint . --ext .ts" }, "dependencies": { - "plasmax-core": "0.59.0" + "plasmax-core": "0.60.2-dev.0" }, "devDependencies": { "@types/node": "16.7.13", @@ -25,4 +25,4 @@ "main": "src/index.ts", "module": "esm/index.js", "types": "index.d.ts" -} +} \ No newline at end of file diff --git a/packages/web/package-lock.json b/packages/web/package-lock.json index 949a0a72..0ba34a49 100644 --- a/packages/web/package-lock.json +++ b/packages/web/package-lock.json @@ -1,15 +1,15 @@ { "name": "plasmax-web", - "version": "0.109.0", + "version": "0.110.2-dev.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "plasmax-web", - "version": "0.109.0", + "version": "0.110.2-dev.0", "license": "MIT", "dependencies": { - "plasmax-hope": "0.72.0" + "plasmax-hope": "0.73.2-dev.0" }, "devDependencies": { "@types/node": "16.7.13", @@ -117,16 +117,16 @@ "dev": true }, "node_modules/plasmax-core": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.59.0.tgz", - "integrity": "sha512-ZPEuKNf3wsBLuGaQBM9R/LZMMufSIWa6IuC7M0qJ+sqPzVBZ7d/q7Lv52FhLWwzaqk/w6tExM1ijiuGP3LzVnA==" + "version": "0.60.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.60.2-dev.0.tgz", + "integrity": "sha512-nj4mBmNDfw8Mxdlg22WVWqm/v9OqQY+ScLdeng4sKqbJW4aBxFNmILSQr9wiItWesnoi+4uh0ey07U7lCiDOrA==" }, "node_modules/plasmax-hope": { - "version": "0.72.0", - "resolved": "https://registry.npmjs.org/plasmax-hope/-/plasmax-hope-0.72.0.tgz", - "integrity": "sha512-UNYL9/sD4PB7+ExUqivyFbQnhsfrKKZ8RAV1symkvXA93plMGaD81Dp42fB6j9QVnd8zO3HvFt6xRXb6rXu6Hg==", + "version": "0.73.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-hope/-/plasmax-hope-0.73.2-dev.0.tgz", + "integrity": "sha512-Mxm7e7J4CDxBPaK6ZICSxU4LvQIIhxOCPZjQUGeP9POSX3KNdE4YwMKb0if6P6e5/OsUcD2n9rfHVfyxdvXhZQ==", "dependencies": { - "plasmax-core": "0.59.0" + "plasmax-core": "0.60.2-dev.0" } }, "node_modules/ts-node": { @@ -276,16 +276,16 @@ "dev": true }, "plasmax-core": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.59.0.tgz", - "integrity": "sha512-ZPEuKNf3wsBLuGaQBM9R/LZMMufSIWa6IuC7M0qJ+sqPzVBZ7d/q7Lv52FhLWwzaqk/w6tExM1ijiuGP3LzVnA==" + "version": "0.60.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-core/-/plasmax-core-0.60.2-dev.0.tgz", + "integrity": "sha512-nj4mBmNDfw8Mxdlg22WVWqm/v9OqQY+ScLdeng4sKqbJW4aBxFNmILSQr9wiItWesnoi+4uh0ey07U7lCiDOrA==" }, "plasmax-hope": { - "version": "0.72.0", - "resolved": "https://registry.npmjs.org/plasmax-hope/-/plasmax-hope-0.72.0.tgz", - "integrity": "sha512-UNYL9/sD4PB7+ExUqivyFbQnhsfrKKZ8RAV1symkvXA93plMGaD81Dp42fB6j9QVnd8zO3HvFt6xRXb6rXu6Hg==", + "version": "0.73.2-dev.0", + "resolved": "https://registry.npmjs.org/plasmax-hope/-/plasmax-hope-0.73.2-dev.0.tgz", + "integrity": "sha512-Mxm7e7J4CDxBPaK6ZICSxU4LvQIIhxOCPZjQUGeP9POSX3KNdE4YwMKb0if6P6e5/OsUcD2n9rfHVfyxdvXhZQ==", "requires": { - "plasmax-core": "0.59.0" + "plasmax-core": "0.60.2-dev.0" } }, "ts-node": { diff --git a/packages/web/package.json b/packages/web/package.json index 223566fc..d0aa3aae 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "plasmax-web", - "version": "0.109.0", + "version": "0.110.2-dev.0", "author": "Alex Czech ", "license": "MIT", "description": "asdasdasdasasdas", @@ -15,7 +15,7 @@ "lint": "eslint . --ext .ts" }, "dependencies": { - "plasmax-hope": "0.72.0" + "plasmax-hope": "0.73.2-dev.0" }, "devDependencies": { "@types/node": "16.7.13", @@ -25,4 +25,4 @@ "main": "src/index.ts", "module": "esm/index.js", "types": "index.d.ts" -} +} \ No newline at end of file diff --git a/utils/pack/package.json b/utils/pack/package.json index b0b965ce..cfb4436b 100644 --- a/utils/pack/package.json +++ b/utils/pack/package.json @@ -1,6 +1,6 @@ { "name": "plasmax-pack", - "version": "0.51.0", + "version": "0.52.2-dev.0", "author": "Alex Czech ", "license": "MIT", "private": true, @@ -8,7 +8,7 @@ "access": "restricted" }, "dependencies": { - "plasmax-core": "0.59.0", + "plasmax-core": "0.60.2-dev.0", "plasmax-tools": "file:./utils/tools" }, "devDependencies": { @@ -18,4 +18,4 @@ "clean": "rm -rf lib", "install:dev": "npm i -D plasmax-core@dev" } -} +} \ No newline at end of file diff --git a/utils/tools/package.json b/utils/tools/package.json index 87273ed8..2e219394 100644 --- a/utils/tools/package.json +++ b/utils/tools/package.json @@ -1,6 +1,6 @@ { "name": "plasmax-tools", - "version": "0.53.0", + "version": "0.54.2-dev.0", "author": "Alex ", "license": "MIT", "private": true, @@ -8,7 +8,7 @@ "access": "restricted" }, "dependencies": { - "plasmax-core": "0.59.0" + "plasmax-core": "0.60.2-dev.0" }, "devDependencies": { "typescript": "5.2.2" @@ -17,4 +17,4 @@ "clean": "rm -rf lib", "install:dev": "npm i plasmax-core@dev" } -} +} \ No newline at end of file