Skip to content

Commit

Permalink
New Build Process (#420)
Browse files Browse the repository at this point in the history
* Update build process to use one branch system

* Update CONTRIBUTING.md to use master branch not dev

- Also mention JS files must be manually updated when PR from fork

* Added comments to the build process

* Updating JS files

Co-authored-by: akwanpdf <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 19, 2021
1 parent 9961496 commit 4a476e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/jsBuilder.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Transpile TS

on:
push:
branches: [dev] # <-- Change this to the primary branch (for example, "dev" if you want all changes to `dev` to be watched).
pull_request:
branches: [master]

jobs:
build:
Expand All @@ -13,6 +13,7 @@ jobs:
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.
ref: ${{ github.event.pull_request.head.sha }} # checks out the branch being merged into `master`

- name: Install dependencies
run: |
Expand All @@ -25,7 +26,7 @@ jobs:
cache: 'npm'

- name: Build JavaScript files
run: | # Change last line to your build script command #.
run: | # Change line to your build script command.
npm run start
- name: Force add JS files to override .gitignore
Expand All @@ -35,11 +36,10 @@ jobs:
run: | # Change last line to your preferred commit message (I like `chore: build js files`).
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Updating JS files" -a
git commit -m "Updating JS files" -a || echo "No commit needed. JS files are already up-to-date"
- name: Push changes
uses: ad-m/[email protected]
with:
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master # <-- Change this to the branch where you want builds to be (for example, "master" if you want changes to the primary branch to be applied to `master`).
branch: ${{ github.event.pull_request.head.ref }} # pushes the commit to the branch being merged into `master`
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

## Pull requests
1. Fork the repository.
2. Create a branch from `dev`.
2. Create a branch from `master`.
3. Update the source code (in `*.ts` files).
4. Commit and push the changes with descriptive messages.
5. Create a pull request to `dev`.
4. Create a pull request to `master`.

\* Please note that all pull requests should be tied to an issue, and all but the most trivial pull requests should be discussed beforehand.
\*\* Changes made to `dev` will automatically be applied to `master`. For more detailed information on developing post-TypeScript migration, see the [wiki](https://github.com/PDFTron/pdftron-react-native/wiki).
Please note:
- All pull requests should be tied to an issue, and all but the most trivial pull requests should be discussed beforehand.
- Every PR needs 1 approving review to be merged into `master` (unless you are an administrator of the repo).
- When PRs are made from a fork, the GitHub Actions script that updates and commits JS files will not succeed due to safety reasons. Instead, the JS files will have to be updated manually.

0 comments on commit 4a476e9

Please sign in to comment.