-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Deploy to npm using GitHub Action.
* Added CLA agreement.
- Loading branch information
Showing
15 changed files
with
962 additions
and
656 deletions.
There are no files selected for viewing
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,44 @@ | ||
# Source: https://github.com/contributor-assistant/github-action | ||
name: "CLA Assistant" | ||
on: | ||
issue_comment: | ||
types: [ created ] | ||
pull_request_target: | ||
types: [ opened,closed,synchronize ] | ||
|
||
# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings | ||
permissions: | ||
actions: write | ||
contents: write | ||
pull-requests: write | ||
statuses: write | ||
|
||
jobs: | ||
CLAAssistant: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "CLA Assistant" | ||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' | ||
uses: contributor-assistant/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# the below token should have repo scope and must be manually added by you in the repository's secret | ||
# This token is required only if you have configured to store the signatures in a remote repository/organization | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACCESS_TOKEN }} | ||
with: | ||
path-to-signatures: 'cla/version1/signatures/cla.json' | ||
path-to-document: 'https://github.com/cowwoc/requirements.js/blob/master/cla/version1/cla.md' # e.g. a CLA or a DCO document | ||
# branch should not be protected | ||
branch: 'main' | ||
allowlist: cowwoc | ||
|
||
# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken | ||
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository) | ||
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository) | ||
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures' | ||
#signed-commit-message: 'For example: $contributorName has signed the CLA in $owner/$repo#$pullRequestNo' | ||
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign' | ||
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA' | ||
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.' | ||
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true) | ||
#use-dco-flag: true - If you are using DCO instead of CLA |
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,138 @@ | ||
name: Deploy to npm | ||
on: | ||
workflow_dispatch: | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
jobs: | ||
open-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
INITIAL_MASTER_POSITION: ${{ steps.create-tag.outputs.INITIAL_MASTER_POSITION }} | ||
INITIAL_GH_PAGES_POSITION: ${{ steps.create-tag.outputs.INITIAL_GH_PAGES_POSITION }} | ||
TAG: ${{ steps.create-tag.outputs.TAG }} | ||
VERSION: ${{ steps.create-tag.outputs.VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Configure Git User | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Gili Tzabari" | ||
# Getting the current git tag: https://stackoverflow.com/a/50465671/14731 | ||
# | ||
# Setting a GitHub Action output parameter: | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter | ||
# Extracting the release version number: https://stackoverflow.com/a/16623897/14731 | ||
- name: Create tag | ||
id: create-tag | ||
run: | | ||
echo "INITIAL_MASTER_POSITION=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | ||
./mvnw release:prepare --batch-mode -V -e | ||
TAG=$(git describe --tag --abbrev=0) | ||
echo "TAG=${TAG}" >> "$GITHUB_OUTPUT" | ||
echo "VERSION=${TAG#"release-"}" >> "$GITHUB_OUTPUT" | ||
deploy: | ||
name: Deploy | ||
needs: open-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.open-release.outputs.TAG }} | ||
token: ${{ secrets.WORKFLOW_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install pnpm | ||
run: | | ||
corepack enable | ||
corepack prepare pnpm@latest --activate | ||
# pnpm dependencies cannot be cached until pnpm is installed | ||
# WORKAROUND: https://github.com/actions/setup-node/issues/531 | ||
- name: Extract cached dependencies | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
|
||
- name: Test build | ||
run: pnpm run build | ||
|
||
- name: Deploy to npm | ||
run: | | ||
cd target\publish | ||
copy ..\..\pnpm-lock.yaml . | ||
pnpm publish --provenance --access=public | ||
mkdir --parents "${{ needs.open-release.outputs.VERSION }}/docs" | ||
mv target/reports/apidocs "${{ needs.open-release.outputs.VERSION }}/docs/api" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# Cleanup on failure: https://stackoverflow.com/a/74562058/14731 | ||
on-failure: | ||
needs: [ open-release, deploy ] | ||
runs-on: ubuntu-latest | ||
if: ${{ failure() || cancelled() }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
token: ${{ secrets.WORKFLOW_TOKEN }} | ||
fetch-depth: 0 | ||
- name: Install node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install pnpm | ||
run: | | ||
corepack enable | ||
corepack prepare pnpm@latest --activate | ||
# pnpm dependencies cannot be cached until pnpm is installed | ||
# WORKAROUND: https://github.com/actions/setup-node/issues/531 | ||
- name: Extract cached dependencies | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
|
||
- name: Restore the master ref to its original position | ||
if: needs.open-release.outputs.INITIAL_MASTER_POSITION != '' | ||
run: | | ||
CURRENT_REF_POSITION=$(git rev-parse HEAD) | ||
if [ "${CURRENT_REF_POSITION}" != "${{ needs.open-release.outputs.INITIAL_MASTER_POSITION }}" ]; then | ||
git reset --hard ${{ needs.open-release.outputs.INITIAL_MASTER_POSITION }} | ||
if [ "${{ github.ref_type }}" == "tag" ]; then | ||
git ${{ github.ref_type }} -f ${{ github.ref_name }} | ||
fi | ||
git push -f origin ${{ github.ref_name }} | ||
fi | ||
- name: Delete tag | ||
if: needs.open-release.outputs.TAG != '' | ||
run: | | ||
git push --delete origin ${{ needs.open-release.outputs.TAG }} | ||
- name: Restore the gh-pages ref to its original position | ||
if: needs.open-release.outputs.INITIAL_GH_PAGES_POSITION != '' | ||
run: | | ||
CURRENT_REF_POSITION=$(git rev-parse HEAD) | ||
if [ "${CURRENT_REF_POSITION}" != "${{ needs.open-release.outputs.INITIAL_GH_PAGES_POSITION }}" ]; then | ||
git reset --hard ${{ needs.open-release.outputs.INITIAL_GH_PAGES_POSITION }} | ||
if [ "${{ github.ref_type }}" == "tag" ]; then | ||
git ${{ github.ref_type }} -f ${{ github.ref_name }} | ||
fi | ||
git push -f origin ${{ github.ref_name }} | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,18 @@ | ||
# Contributor License Agreements | ||
|
||
Whenever someone wants to submit a patch to open source projects, they must first sign a Contributor License | ||
Agreement (CLA). This allows the contributor to retain their ownership in the code submitted while granting | ||
the project owner the necessary legal rights to use that contribution. The CLA only needs to be signed once | ||
and it covers projects by the same project owner. | ||
|
||
## Why do we even have a CLA? | ||
|
||
Our CLA allows open source projects administered by the project owner to safely accept code and documentation | ||
from external contributors. | ||
|
||
## What's in the CLA? | ||
|
||
Our CLAs are based on the Apache Software Foundation's CLAs. | ||
|
||
* [Corporate CLA](corporate-cla.md) - For entities signing on behalf of their employees. | ||
* [Individual CLA](individual-cla.md) - For individuals. |
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,71 @@ | ||
# Software Grant and Corporate Contributor License Agreement | ||
|
||
In order to clarify the intellectual property license granted with Contributions from any person or entity, | ||
Gili Tzabari ("The Owner") must have a Contributor License Agreement (CLA) on file that has been signed by | ||
each Contributor, indicating agreement to the license terms below. This license is for your protection as a | ||
Contributor as well as the protection of The Owner and its users; it does not change your rights to use your | ||
own Contributions for any other purpose. | ||
|
||
This version of the Agreement allows an entity (the "Corporation") to submit Contributions to The Owner, to | ||
authorize Contributions submitted by its designated employees to The Owner, and to grant copyright and patent | ||
licenses thereto. | ||
|
||
You accept and agree to the following terms and conditions for Your present and future Contributions submitted | ||
to The Owner. Except for the license granted herein to The Owner and recipients of software distributed by | ||
The Owner, You reserve all right, title, and interest in and to Your Contributions. | ||
|
||
- **Definitions**. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the | ||
copyright owner that is making this Agreement with The Owner. For legal entities, the entity making a | ||
Contribution and all other entities that control, are controlled by, or are under common control with that | ||
entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) | ||
the power, direct or indirect, to cause the direction or management of such entity, whether by contract or | ||
otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial | ||
ownership of such entity.<br> | ||
<br> | ||
"Contribution" shall mean the code, documentation or any original work of authorship, including any | ||
modifications or additions to an existing work, that is intentionally submitted by You to The Owner for | ||
inclusion in, or documentation of, any of the products owned or managed by The Owner (the "Work"). For the | ||
purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent | ||
to The Owner or its representatives, including but not limited to communication on electronic mailing lists, | ||
source code control systems, and issue tracking systems that are managed by, or on behalf of, The Owner for | ||
the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked | ||
or otherwise designated in writing by You as "Not a Contribution." | ||
|
||
- **Grant of Copyright License**. Subject to the terms and conditions of this Agreement, You hereby grant to | ||
The Owner and to recipients of software distributed by The Owner a perpetual, worldwide, non-exclusive, | ||
no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly | ||
display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. | ||
|
||
- **Grant of Patent License**. Subject to the terms and conditions of this Agreement, You hereby grant to The | ||
Owner and to recipients of software distributed by The Owner a perpetual, worldwide, non-exclusive, | ||
no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, | ||
use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those | ||
patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by | ||
combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity | ||
institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a | ||
lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or | ||
contributory patent infringement, then any patent licenses granted to that entity under this Agreement for | ||
that Contribution or Work shall terminate as of the date such litigation is filed. | ||
|
||
- You represent that You are legally entitled to grant the above license. You represent further that each | ||
employee of the Corporation designated by You is authorized to submit Contributions on behalf of the | ||
Corporation. | ||
|
||
- You represent that each of Your Contributions is Your original creation (see section 7 for submissions on | ||
behalf of others). | ||
|
||
- You are not expected to provide support for Your Contributions, except to the extent You desire to provide | ||
support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or | ||
agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | ||
OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of | ||
TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
- Should You wish to submit work that is not Your original creation, You may submit it to The Owner separately | ||
from any Contribution, identifying the complete details of its source and of any license or other | ||
restriction (including, but not limited to, related patents, trademarks, and license agreements) of which | ||
you are personally aware, and conspicuously marking the work as "Submitted on behalf of a | ||
third-party: [named here]". | ||
|
||
- It is your responsibility to notify The Owner when any change is required to the list of designated | ||
employees authorized to submit Contributions on behalf of the Corporation, or to the Corporation's Point of | ||
Contact with The Owner. |
Oops, something went wrong.