diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..69b26b6f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ + +### Summary + + + +### Checklist + +* [ ] Does your PR title have the correct [title format](../CONTRIBUTING.md#pr-commit-title-conventions) +* [ ] Does your PR have a breaking change? diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 00000000..b173c0d8 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,19 @@ +# Validate the PR title, and ignore the commits +titleOnly: true + +# By default types specified in commitizen/conventional-commit-types is used. +# See: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json +# You can override the valid types + +types: + - feat + - fix + - perf + - docs + - test + - refactor + - style + - build + - ci + - chore + - revert diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..95272052 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +name: Release + +on: + workflow_dispatch: + inputs: + dryRun: + description: 'Do a dry run instead of real release' + required: true + default: 'true' + +jobs: + authorize: + name: Authorize + runs-on: ubuntu-18.04 + steps: + - name: ${{ github.actor }} permission check to do a release + uses: octokit/request-action@v2.0.0 + with: + route: GET /repos/:repository/collaborators/${{ github.actor }} + repository: ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Release + runs-on: ubuntu-18.04 + needs: [authorize] + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8.x' + - name: Install boto3 for deployjs.python + run: pip install boto3==1.14.63 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 10.x + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run tests + run: make test + + - name: Release --dry-run # Uses release.config.js + if: ${{ github.event.inputs.dryRun == 'true'}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} + run: npx semantic-release --dry-run + + - name: Release # Uses release.config.js + if: ${{ github.event.inputs.dryRun == 'false'}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} + run: npx semantic-release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a2e91173 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + node-version: [10.x, 12.x, 14.x] + # os: [macos-10.14, ubuntu-18.04] @TODO See if MacOS test can be fixed + os: [ubuntu-18.04] + runs-on: ${{ matrix.os }} + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: yarn install + run: | + yarn install --frozen-lockfile + + - name: Build and run tests + run: | + make test diff --git a/CHANGELOG.md b/CHANGELOG.md index 597118fb..46cfa0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### As of September 21, 2020 CHANGELOG.md is no longer manually updated. Please check the [releases page](https://github.com/amplitude/Amplitude-JavaScript/releases) for up to date changes. + ### 7.1.1 (August 26, 2020) * Fix an issue with detection of whether or not cookies are enabled on a device diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6382d21..e796a357 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,11 @@ # Contributing to the Amplitude SDK for JavaScript + 🎉 Thanks for your interest in contributing! 🎉 ## Ramping Up + ### Intro + - There are three ways for SDK to be loaded - Standard NPM package - Snippet in `