-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pre-release-branch-update GitHub action. Fix prev commit
- Loading branch information
Alexey Zorkaltsev
authored and
Alexey Zorkaltsev
committed
Sep 13, 2023
1 parent
1c0f9e8
commit 9c66dd7
Showing
4 changed files
with
71 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Action setup: | ||
# | ||
# Copy this action to .github/workflows | ||
# | ||
# Add YDB_PLATFORM_BOT_TOKEN_REPO, which is Personal Access Token (PAT), to secrets or rename YDB_PLATFORM_BOT_TOKEN_REPO in this code to an already existing token | ||
# | ||
# Add to .gitignore a comment before line that ignores result of the build with the following postfix: | ||
# (next line will be removed by pre-release-branch-update GitHub action to be included in dist branch) | ||
# | ||
# Copy PRE-RELEASE.md rom this project | ||
|
||
name: Pre-Release branch update | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash | ||
- name: Remove build result from .gitignore | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
with: | ||
include: ".gitignore" | ||
find: "#.*\\(next line will be removed by pre-release-branch-update GitHub action to be included in dist branch\\)\\n.*\\n" | ||
replace: "###\n" | ||
- name: .gitignore | ||
run: cat .gitignore | ||
shell: bash | ||
- name: Build typescript project | ||
run: npm run build | ||
shell: bash | ||
- name: ls | ||
run: ls | ||
shell: bash | ||
- name: Commit files to pre-release branch | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "pre-release-to-branch[action]" | ||
git add . | ||
git commit -a -m "Typescript build" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }} | ||
branch: "pre-release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# PRE-RELEASE project preview | ||
|
||
The idea of Pre-release is to let the project can be tried out before the official release when the project code is | ||
committed to npm with a new version assignment. | ||
|
||
GitHub action pre-release-branch-update takes action when an code update was pushed to the main (master) | ||
branch. The action performs the project build, enabling save the result in git, and saves the result to | ||
the pre-release branch. | ||
|
||
Later, this code can be tested by adding to a test project using command | ||
*npm install https://github.com/ydb-platform/ydb-nodejs-sdk.git#pre-release*. | ||
|
||
When making changes to a project and building a new pre-release version by git push. It is **necessary** | ||
to update the code of the component in test projects via *npm update*. |