Skip to content

Commit

Permalink
Setup ci (#5)
Browse files Browse the repository at this point in the history
* setup ci

* replace snapshot dependencies

---------

Co-authored-by: Wenxi Zeng <[email protected]>
  • Loading branch information
wenxi-zeng and Wenxi Zeng authored May 3, 2024
1 parent 883aa61 commit 94b13a1
Show file tree
Hide file tree
Showing 10 changed files with 235 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: triage
assignees: wenxi-zeng

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Do '...'
2. '....'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Platform (please complete the following information):**
- Library Version in use: [e.g. 0.0.5]
- Platform being tested: [e.g. Android]
- Integrations in use: [e.g. Firebase, Amplitude]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: triage
assignees: prayansh

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Purpose
_Describe the problem or feature in addition to a link to the issues._

## Approach
_How does this change address the problem?_

#### Open Questions and Pre-Merge TODOs
- [ ] Use github checklists. When solved, check the box and explain the answer.

## Learning
_Describe the research stage_

_Links to blog posts, patterns, libraries or addons used to solve this problem_
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

permissions: write-all

jobs:
cancel_previous:

runs-on: ubuntu-latest
steps:
- uses: styfle/[email protected]
with:
workflow_id: ${{ github.event.workflow.id }}

build:

needs: cancel_previous
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Tests
run: ./gradlew check
39 changes: 39 additions & 0 deletions .github/workflows/create_jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create Jira Ticket

on:
issues:
types:
- opened

jobs:
create_jira:
name: Create Jira Ticket
runs-on: ubuntu-latest
environment: IssueTracker
steps:
- name: Checkout
uses: actions/checkout@master
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_TOKEN }}
JIRA_EPIC_KEY: ${{ secrets.JIRA_EPIC_KEY }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}

- name: Create
id: create
uses: atlassian/gajira-create@master
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: Bug
summary: |
[${{ github.event.repository.name }}] (${{ github.event.issue.number }}): ${{ github.event.issue.title }}
description: |
Github Link: ${{ github.event.issue.html_url }}
${{ github.event.issue.body }}
fields: '{"parent": {"key": "${{ secrets.JIRA_EPIC_KEY }}"}}'

- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
tags:
- '*.*.*'
-
permissions: write-all

jobs:
release:
runs-on: ubuntu-latest
environment: deployment
steps:
- uses: actions/checkout@v2
- name: Get tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Verify tag
run: |
VERSION=$(grep VERSION_NAME gradle.properties | awk -F= '{ print $2 }' | sed "s/-SNAPSHOT//")
if [ "${{ steps.vars.outputs.tag }}" != "$VERSION" ]; then {
echo "Tag ${{ steps.vars.outputs.tag }} does not match the package version ($VERSION)"
exit 1
} fi
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-core-
- name: Publush release to sonatype
run: ./gradlew clean build publishToSonatype -Prelease closeAndReleaseSonatypeStagingRepository
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}

- name: create release
run: |
curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/${{github.repository}}/releases \
-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}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
31 changes: 31 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Snapshot

on:
push:
branches: [ main ]

jobs:
snapshot:
runs-on: ubuntu-latest
environment: deployment
steps:
- uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-core-
- name: Publush snapshot to sonatype
run: ./gradlew clean build publishToSonatype
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}
6 changes: 3 additions & 3 deletions destination-filters-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ android {
}

dependencies {
implementation ("com.segment.analytics.kotlin:analytics-kotlin-live:0.2.1-SNAPSHOT")
implementation("com.segment.analytics.kotlin:substrata:0.0.8-SNAPSHOT")
implementation 'com.segment.analytics.kotlin:android:1.15.0'
implementation 'com.segment.analytics.kotlin:analytics-kotlin-live:1.0.0'
implementation 'com.segment.analytics.kotlin:substrata:1.0.0'
implementation 'com.segment.analytics.kotlin:android:1.16.0'
implementation 'androidx.core:core-ktx:1.9.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {

dependencies {
implementation project(":destination-filters-kotlin")
implementation("com.segment.analytics.kotlin:substrata:0.0.8-SNAPSHOT")
implementation 'com.segment.analytics.kotlin:android:1.15.0'
implementation 'com.segment.analytics.kotlin:substrata:1.0.0'
implementation 'com.segment.analytics.kotlin:android:1.16.0'

implementation 'com.segment.analytics.kotlin.destinations:appsflyer:1.5.1'

Expand Down
3 changes: 0 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ dependencyResolutionManagement {
mavenLocal()
google()
mavenCentral()
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
rootProject.name = "DestinationFilters-Kotlin"
Expand Down

0 comments on commit 94b13a1

Please sign in to comment.