Skip to content

Commit 87f6acb

Browse files
committed
open source release
0 parents  commit 87f6acb

File tree

27 files changed

+1510
-0
lines changed

27 files changed

+1510
-0
lines changed

.github/CONTRIBUTING.md

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: triage
6+
assignees: bsneed
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Do '...'
16+
2. '....'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Platform (please complete the following information):**
26+
- Library Version in use: [e.g. 0.0.5]
27+
- Platform being tested: [e.g. Android]
28+
- Integrations in use: [e.g. Firebase, Amplitude]
29+
30+
**Additional context**
31+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: triage
6+
assignees: prayansh
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Purpose
2+
_Describe the problem or feature in addition to a link to the issues._
3+
4+
## Approach
5+
_How does this change address the problem?_
6+
7+
#### Open Questions and Pre-Merge TODOs
8+
- [ ] Use github checklists. When solved, check the box and explain the answer.
9+
10+
## Learning
11+
_Describe the research stage_
12+
13+
_Links to blog posts, patterns, libraries or addons used to solve this problem_

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
12+
cancel_previous:
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: styfle/cancel-workflow-action@0.9.1
17+
with:
18+
workflow_id: ${{ github.event.workflow.id }}
19+
20+
build:
21+
22+
needs: cancel_previous
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
- name: cache gradle dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
36+
restore-keys: |
37+
${{ runner.os }}-gradle-
38+
- name: Run Tests
39+
run: ./gradlew check

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
environment: deployment
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Get tag
15+
id: vars
16+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
17+
- name: Verify tag
18+
run: |
19+
VERSION=$(grep VERSION_NAME gradle.properties | awk -F= '{ print $2 }' | sed "s/-SNAPSHOT//")
20+
if [ "${{ steps.vars.outputs.tag }}" != "$VERSION" ]; then {
21+
echo "Tag ${{ steps.vars.outputs.tag }} does not match the package version ($VERSION)"
22+
exit 1
23+
} fi
24+
25+
- name: Grant execute permission for gradlew
26+
run: chmod +x gradlew
27+
- name: cache gradle dependencies
28+
uses: actions/cache@v2
29+
with:
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
34+
restore-keys: |
35+
${{ runner.os }}-gradle-core-
36+
- name: Publush release to sonatype
37+
run: ./gradlew publishToSonatype -Prelease closeAndReleaseSonatypeStagingRepository
38+
env:
39+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
40+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
41+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
42+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
43+
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}
44+
45+
- name: create release
46+
run: |
47+
curl \
48+
-X POST \
49+
-H "Authorization: token $GITHUB_TOKEN" \
50+
https://api.github.com/repos/${{github.repository}}/releases \
51+
-d '{"tag_name": "${{ env.RELEASE_VERSION }}", "name": "${{ env.RELEASE_VERSION }}", "body": "Release of version ${{ env.RELEASE_VERSION }}", "draft": false, "prerelease": false, "generate_release_notes": true}'
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}

.github/workflows/snapshot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Snapshot
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
snapshot:
9+
runs-on: ubuntu-latest
10+
environment: deployment
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Grant execute permission for gradlew
14+
run: chmod +x gradlew
15+
- name: cache gradle dependencies
16+
uses: actions/cache@v2
17+
with:
18+
path: |
19+
~/.gradle/caches
20+
~/.gradle/wrapper
21+
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
22+
restore-keys: |
23+
${{ runner.os }}-gradle-core-
24+
- name: Publush snapshot to sonatype
25+
run: ./gradlew publishToSonatype
26+
env:
27+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
28+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
29+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
30+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
31+
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
.idea
8+
9+
lib/build

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// add badges and stuff here
2+
3+
# Destination
4+
5+
## Getting Started
6+
7+
// TODO
8+
9+
10+
## License
11+
```
12+
MIT License
13+
14+
Copyright (c) 2021 Segment
15+
16+
Permission is hereby granted, free of charge, to any person obtaining a copy
17+
of this software and associated documentation files (the "Software"), to deal
18+
in the Software without restriction, including without limitation the rights
19+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
copies of the Software, and to permit persons to whom the Software is
21+
furnished to do so, subject to the following conditions:
22+
23+
The above copyright notice and this permission notice shall be included in all
24+
copies or substantial portions of the Software.
25+
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32+
SOFTWARE.
33+
```

RELEASING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Update Version
2+
=========
3+
1. Update VERSION_CODE in `gradle.properties`
4+
2. Update VERSION_NAME in `gradle.properties`
5+
6+
Releasing
7+
=========
8+
9+
1. Create a new branch called `release/X.Y.Z`
10+
2. `git checkout -b release/X.Y.Z`
11+
3. Change the version in `gradle.properties` to your desired release version (see `Update Version`)
12+
4. `git commit -am "Create release X.Y.Z."` (where X.Y.Z is the new version)
13+
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
14+
6. Upgrade to next version by changing version in `gradle.properties`
15+
7. `git commit -am "Prepare snapshot X.Y.Z-SNAPSHOT"`
16+
8. `git push && git push --tags`
17+
9. Create a PR to merge the new branch into `master`
18+
10. The CI pipeline will recognize the tag and upload, close and promote the artifacts automatically, and generate changelog automatically
19+
20+
Example (stable release)
21+
========
22+
1. Current VERSION_NAME in `gradle.properties` = 1.3.0
23+
2. `git checkout -b release/1.3.1`
24+
3. Change VERSION_NAME = 1.3.1 (next higher version)
25+
4. Update CHANGELOG.md
26+
5. `git commit -am "Create release 1.3.1`
27+
6. `git tag -a 1.3.1 -m "Version 1.3.1"`
28+
6. `git push && git push --tags`
29+
7. Change VERSION_NAME = 1.3.2 (next higher version)
30+
8. `git commit -am "Prepare snapshot 1.3.2-SNAPSHOT"`
31+
9. `git push && git push --tags`
32+
10. Merging PR master will create a snapshot release 1.3.2-SNAPSHOT and tag push will create stable release 1.3.1

0 commit comments

Comments
 (0)