Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump 01 #369

Open
wants to merge 23 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/publish-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/publish-rc-wd.yml
Original file line number Diff line number Diff line change
@@ -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 }}
141 changes: 1 addition & 140 deletions .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 5 additions & 3 deletions auto.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand All @@ -33,6 +31,10 @@ module.exports = function rc() {
}

return {
"labels": [
{ "releaseType": "prerelease", "name": "Prerelease" }
],
noVersionPrefix: true,
prereleaseBranches: ['dev'],
plugins,
};
Expand Down
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
},
"init": {
"exact": true
},
"version": {
"conventionalCommits": true,
"conventionalPrerelease": true,
"conventionalBumpPrerelease": true,
"preid": "dev"
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "plasmax-core",
"version": "0.59.0",
"version": "0.60.2-dev.0",
"author": "Alex Czech1 <[email protected]>",
"description": "ddasdasd",
"description": "asdasdas",
"license": "MIT",
"scripts": {
"prepare": "npm run build",
Expand Down
18 changes: 9 additions & 9 deletions packages/hope/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/hope/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plasmax-hope",
"version": "0.72.0",
"version": "0.73.2-dev.0",
"author": "Alex Czech <[email protected]>",
"license": "MIT",
"description": "33333",
Expand All @@ -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",
Expand All @@ -25,4 +25,4 @@
"main": "src/index.ts",
"module": "esm/index.js",
"types": "index.d.ts"
}
}
34 changes: 17 additions & 17 deletions packages/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading