Skip to content

Commit

Permalink
Merge pull request #2 from Maninda/master
Browse files Browse the repository at this point in the history
Add Ballerina AWS SES Connector
  • Loading branch information
Maninda authored Jul 22, 2020
2 parents 5880b2f + c443018 commit 534cff6
Show file tree
Hide file tree
Showing 25 changed files with 2,053 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build master branch

on:
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: |
./gradlew publish
40 changes: 40 additions & 0 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Daily build

on:
schedule:
- cron: '0 */12 * * *'

jobs:
ubuntu-build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: ./gradlew build

windows-build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: ./gradlew.bat build
29 changes: 29 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish release

on:
release:
types: [published]

jobs:
publish-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
echo "Github username: ${GITHUB_ACTOR}"
./gradlew -PpublishToCentral=true -Pversion=${NEW_VERSION} publish
38 changes: 38 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Ballerina AWS SES module build

on: [push, pull_request]

jobs:
ubuntu-build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: ./gradlew build

windows-build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.BALLERINA_STDLIB_TOKEN }}
run: ./gradlew.bat build
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Log file
*.log

#conf file
ballerina.conf

# BlueJ files
*.ctxt

Expand All @@ -21,3 +24,21 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Ignore everything in this directory
target
.classpath
.settings
.project
*.iml
*.iws
*.ipr
.idea
.m2
.vscode/
*.ballerina/

# Ignore ballerina files
temp.bal.ballerina/
target/
.DS_Store
46 changes: 46 additions & 0 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

plugins {
id "de.undercouch.download"
}

task downloadMultipleFiles(type: Download) {
src([
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/checkstyle.xml',
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/suppressions.xml'
])
overwrite false
onlyIfNewer true
dest buildDir
}

jar {
enabled = false
}

clean {
enabled = false
}

artifacts.add('default', file("$project.buildDir/checkstyle.xml")) {
builtBy('downloadMultipleFiles')
}

artifacts.add('default', file("$project.buildDir/suppressions.xml")) {
builtBy('downloadMultipleFiles')
}
116 changes: 116 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

plugins {
id "com.github.spotbugs" version "4.0.5"
id "de.undercouch.download" version "4.0.4"
id "net.researchgate.release" version "2.6.0"
}

ext.ballerinaLangVersion = project.ballerinaLangVersion
ext.puppycrawlCheckstyleVersion = project.puppycrawlCheckstyleVersion
ext.testngVersion = "6.14.3"
ext.slf4jVersion = project.slf4jVersion
ext.stdlibEncodingVersion = project.stdlibEncodingVersion

allprojects {
group = project.group
version = project.version

apply plugin: 'jacoco'
apply plugin: 'maven-publish'

repositories {
mavenLocal()
maven {
url = 'https://maven.wso2.org/nexus/content/repositories/releases/'
}

maven {
url = 'https://maven.wso2.org/nexus/content/repositories/snapshots/'
}

maven {
url = 'https://maven.wso2.org/nexus/content/groups/wso2-public/'
}

maven {
url = 'https://maven.wso2.org/nexus/content/repositories/orgballerinalang-1509'
}

maven {
url = 'https://repo.maven.apache.org/maven2'
}

maven {
url "https://maven.pkg.github.com/ballerina-platform/module-ballerina-encoding"
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
}
}

subprojects {
apply plugin: 'java'

configurations {
ballerinaStdLibs
}

dependencies {
/* Standard libraries */
ballerinaStdLibs "org.ballerinalang:encoding-ballerina:${stdlibEncodingVersion}"
}

release {
// Disable check snapshots temporarily
buildTasks = []
failOnSnapshotDependencies = false
failOnCommitNeeded = false
versionPropertyFile = 'gradle.properties'
tagTemplate = 'v${version}'
git {
// To release from any branch
requireBranch = null
}
}
}

task codeCoverageReport(type: JacocoReport) {
dependsOn = subprojects.test

executionData fileTree(project.rootDir.absolutePath).include("**/build/coverage-reports/*.exec")

subprojects.each {
sourceSets it.sourceSets.main
}

reports {
xml.enabled = true
html.enabled = true
csv.enabled = true
xml.destination = new File("${buildDir}/reports/jacoco/report.xml")
html.destination = new File("${buildDir}/reports/jacoco/report.html")
csv.destination = new File("${buildDir}/reports/jacoco/report.csv")
}

onlyIf = {
true
}
}
14 changes: 14 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
org.gradle.caching=true
group=org.ballerinalang
version=1.0.0-SNAPSHOT
ballerinaLangVersion=2.0.0-Preview2
ballerinaTomlParserVersion=1.2.2
nettyVersion=4.1.39.Final
nettyTcnativeVersion=2.0.25.Final
puppycrawlCheckstyleVersion=8.18
slf4jVersion=1.7.30
wso2TransportHttpNettyVersion=6.3.9
wso2CommonsPoolVersion=1.5.6.wso2v1
wso2CarbonMetricsVersion=2.3.7
wso2SnakeYamlVersion=1.16.0.wso2v1
stdlibEncodingVersion=1.0.0-SNAPSHOT
Loading

0 comments on commit 534cff6

Please sign in to comment.