Skip to content

Commit

Permalink
- ci - Add shell-functions shGitPullrequestCleanup(), shGitPullreques…
Browse files Browse the repository at this point in the history
…t() to automatically cleanup or create-and-push github-pull-commit to origin/alpha.
  • Loading branch information
kaizhu256 committed Mar 21, 2024
1 parent 45a5319 commit b948941
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -9,7 +9,7 @@ on:
- master
workflow_dispatch:
env:
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
zzzz1234: 1
jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
# Publish to GitHub Packages
- run: sh jslint_ci.sh shCiPublishNpm
env:
NODE_AUTH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_REGISTRY: github

# Setup .npmrc file to publish to npm
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@
- jslint - try to improve parser to be able to parse jquery.js without stopping.

# v2024.3.1-beta
- ci - Add shell-functions shGitPullrequestCleanup(), shGitPullrequest() to automatically cleanup or create-and-push github-pull-commit to origin/alpha.
- jslint - Allow destructuring-assignment after function-definition.
- ci - Replace npm-package used to auto-build vscode-plugin, vsce to @vscode/vsce.
- test - Update test-function jstestDescribe() to wait awhile for imports to initialize before running tests.
Expand Down
160 changes: 77 additions & 83 deletions README.md
Expand Up @@ -74,9 +74,9 @@ Douglas Crockford <douglas@crockford.com>
12. [License](#license)

13. [Devops Instruction](#devops-instruction)
- [pull-request merge](#pull-request-merge)
- [branch-master commit](#branch-master-commit)
- [branch-master publish](#branch-master-publish)
- [pull-request merge](#pull-request-merge)
- [vscode-jslint publish](#vscode-jslint-publish)


Expand Down Expand Up @@ -915,115 +915,109 @@ eval("1"); //jslint-ignore-line


<br><br>
### branch-master commit
- $ `shGitSquashPop <commit-beta> '# v20yy.mm.dd\n<release notes from CHANGELOG.md>'`
- verify correct-year `20yy`
- $ `git push origin alpha:branch-v20yy.mm.dd`
### pull-request merge
- find highest issue-number at https://github.com/jslint-org/jslint/issues/, https://github.com/jslint-org/jslint/pulls/, and add +1 to it for PR-xxx
- $ `shGitPullrequest beta beta`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- goto https://github.com/kaizhu256/jslint/pulls
- click `New pull request`
- click `base repository: jslint-org/jslint base:beta`
- click `head repository: kaizhu256/jslint compare:branch-v20yy.mm.dd`
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.3.21
- click `Create pull request`
- input `Add your description here...` with:
```
Fixes #xxx.
- <primary-commit-message>
This PR will ...
this PR will additionally:
- <secondary-commit-message>
...
<screenshot>
```
- verify `commit into jslint-org:beta`
- click `Create pull request`
- verify ci-success for pull-request
- verify ci-success for pull-request
- https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
- wait awhile before continuing ...
- click `Rebase and merge`
- verify ci-success for upstream-branch-beta
- verify ci-success for upstream-branch-beta
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
```shell
git fetch upstream beta
git diff alpha..upstream/beta
# verify no diff between alpha..upstream/beta
git reset upstream/beta
git push origin alpha -f
git push origin alpha:beta
shMyciUpdate
git push upstream alpha -f
```
- verify ci-success for origin-branch-alpha
- $ `shGitPullrequestCleanup`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- verify ci-success for upstream-branch-alpha
- $ `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- click `Delete branch`
```shell
git push origin beta:master
git push upstream beta:master


<br><br>
### branch-master commit
- $ `shGitPullrequest master beta`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2023.10.24
- click `Create pull request`
- input `Add a title` with: `# v20yy.mm.dd`
- input `Add a description` with:
```
- verify ci-success for origin-branch-master
- <primary-commit-message>
- <secondary-commit-message>
```
- verify `commit into jslint-org:beta`
- click `Create pull request`
- verify ci-success for pull-request
- https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
- wait awhile before continuing ...
- click `Rebase and merge`
- verify ci-success for upstream-branch-beta
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- $ `shGitPullrequestCleanup`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- verify ci-success for upstream-branch-master
- $ `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- click `Delete branch`
- $ `git push origin beta:master`
- verify ci-success for origin-branch-master
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream beta:master`
- verify ci-success for upstream-branch-master
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml


<br><br>
### branch-master publish
- $ `git push upstream beta:master`
- verify ci-success for upstream-branch-master
- verify ci-success for upstream-branch-master
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- goto https://github.com/jslint-org/jslint/releases/new
- input tag `v20yy.mm.dd`
- input `Choose a tag` with: `v20yy.mm.dd`
- click `Create new tag: v20yy.mm.dd on publish`
- verify correct-year `20yy`
- click `Target: master`
- input `Release title: v20yy.mm.dd - <description>`
- copy-paste release notes from CHANGELOG.md
- select `Target: master`
- select `Previous tag:auto`
- input `Release title` with: `v20yy.mm.dd - <primary-commit-message>`
- input `Describe this release` with:
```
- <primary-commit-message>
- <secondary-commit-message>
```
- click `Generate release notes`
- click `Set as the latest release`
- click `Preview` and review
- click `Publish release`
- verify ci-success for upstream-branch-publish
- verify ci-success for upstream-branch-publish
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`


<br><br>
### pull-request merge
- find highest issue-number at https://github.com/jslint-org/jslint/issues/, https://github.com/jslint-org/jslint/pulls/, and add +1 to it for PR-xxx
```shell
git push origin alpha:branch_xxx
git push upstream alpha
```
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:alpha
- select branch to merge
- click `Create pull request`
- `Add a description` template:
```
Fixes #xxx.
- <primary-commit-message>
This PR will ...
this PR will additionally:
- <secondary-commit-messages>
...
<screenshot>
```
- verify `commit into jslint-org:beta`
- click `Create pull request`
- verify ci-success for pull-request
- https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
- click `Rebase and merge`
- verify ci-success for upstream-branch-beta
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
```shell
git fetch upstream beta
git diff alpha..upstream/beta
# verify no diff between alpha..upstream/beta
git reset upstream/beta
git push origin alpha -f
git push origin alpha:beta
shMyciUpdate
git push upstream alpha -f
```
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- click `Delete branch`
- verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`


<br><br>
Expand Down

0 comments on commit b948941

Please sign in to comment.