Skip to content

Commit 3132a24

Browse files
committed
open source release
0 parents  commit 3132a24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

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

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// add badges and stuff here
2+
3+
# Destination
4+
5+
## Getting Started
6+
7+
1. Create repo from this template. The name of the repo should follow this pattern `project-language-destination`. For example `analytics-kotlin-firebase`
8+
2. In `settings.gralde.kts`, change `rootProject.name` to match your repo name.
9+
3. In `gradle.properties`, update the fields with `<>` brackets
10+
4. Delete `com.segment.analytics.kotlin.destinations.Destination.kt`
11+
5. Create a directory with the destination name under `com.segment.analytics.kotlin.destinations`. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase`
12+
6. Create your destination class under the directory created in step 5. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase.Firebase.kt`
13+
7. update Android manifest with your package name. For example Firebase
14+
```xml
15+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
16+
package="com.segment.analytics.kotlin.destinations.firebase">
17+
```
18+
8. Implement destination
19+
9. Add tests
20+
21+
22+
## License
23+
```
24+
MIT License
25+
26+
Copyright (c) 2021 Segment
27+
28+
Permission is hereby granted, free of charge, to any person obtaining a copy
29+
of this software and associated documentation files (the "Software"), to deal
30+
in the Software without restriction, including without limitation the rights
31+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32+
copies of the Software, and to permit persons to whom the Software is
33+
furnished to do so, subject to the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included in all
36+
copies or substantial portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44+
SOFTWARE.
45+
```

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)