Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial project structure with workflows #1

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# See: https://help.github.com/articles/about-codeowners/

# These owners will be the default owners for everything in the repo.
* @NipunaRanasinghe
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Purpose

## Examples

## Checklist
- [ ] Linked to an issue
- [ ] Updated the changelog
- [ ] Added tests
- [ ] Updated the spec
- [ ] Checked native-image compatibility
17 changes: 17 additions & 0 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: GraalVM Check

on:
schedule:
- cron: "30 18 * * *"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build

on:
push:
branches:
- main
- 2201.[0-9]+.x
repository_dispatch:
types: check_connector_for_breaking_changes

jobs:
call_workflow:
name: Run Connector Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-asana
14 changes: 14 additions & 0 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Daily build

on:
schedule:
- cron: "30 2 * * *"

jobs:
call_workflow:
name: Run Daily Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/daily-build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-asana
21 changes: 21 additions & 0 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish to the Ballerina Dev\Stage Central

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select Environment
required: true
options:
- DEV CENTRAL
- STAGE CENTRAL

jobs:
call_workflow:
name: Run Dev\Stage Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/dev-stage-central-publish-connector-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR Build

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

on: pull_request

jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/pr-build-connector-template.yml@main
secrets: inherit
with:
additional-test-flags: ${{ github.event.pull_request.head.repo.full_name != github.repository && '-x test' || ''}}
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish Release

on:
workflow_dispatch:
repository_dispatch:
types: [ stdlib-release-pipeline ]

jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/release-package-connector-template.yml@main
secrets: inherit
with:
package-name: asana
package-org: ballerinax
13 changes: 13 additions & 0 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Trivy

on:
workflow_dispatch:
schedule:
- cron: "30 20 * * *"

jobs:
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit
41 changes: 38 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
# Compiled class file
*.class

*.balx
# Log file
*.log

generated
#Config file
Config.toml

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# .DS_Store files
*.DS_Store

# Package Files #
*.jar
!gradle/wrapper/gradle-wrapper.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

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

# Ignore everything in this directory
target
.classpath
.settings
.project
*.iml
*.iws
*.ipr
.idea
.m2
.vscode/
# Ignore ballerina files
accessToken.bal
temp.bal.ballerina/
target/
.DS_Store
*Ballerina.lock
.ballerina

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# Ignore Docker env file
docker.env

13 changes: 13 additions & 0 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
distribution = "2201.8.6"
org = "ballerinax"
name = "asana"
version = "0.1.0"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["Asana", "Productivity/Project Management", "Cost/Freemium", "Task Management"]
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-asana"

[build-options]
observabilityIncluded = true
1 change: 1 addition & 0 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ballerina Asana Connector
1 change: 1 addition & 0 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ballerina Asana Connector
100 changes: 100 additions & 0 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you 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.
*/

import org.apache.tools.ant.taskdefs.condition.Os

plugins {
id 'io.ballerina.plugin'
}

description = 'Asana - Ballerina'

def packageName = "asana"
def packageOrg = "ballerinax"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/Ballerina.toml")
def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml")

def stripBallerinaExtensionVersion(String extVersion) {
if (extVersion.matches(project.ext.timestampedVersionRegex)) {
def splitVersion = extVersion.split('-')
if (splitVersion.length > 3) {
def strippedValues = splitVersion[0..-4]
return strippedValues.join('-')
} else {
return extVersion
}
} else {
return extVersion.replace("${project.ext.snapshotVersion}", "")
}
}

ballerina {
packageOrganization = packageOrg
module = packageName
testCoverageParam = "--code-coverage --coverage-format=xml"
isConnector = true
platform = "any"
}

task updateTomlFiles {
doLast {
def newBallerinaToml = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version)
newBallerinaToml = newBallerinaToml.replace("@toml.version@", tomlVersion)
ballerinaTomlFile.text = newBallerinaToml
}
}

task commitTomlFiles {
doLast {
project.exec {
ignoreExitValue true
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the toml files\" Ballerina.toml Dependencies.toml"
} else {
commandLine 'sh', '-c', "git commit -m '[Automated] Update the toml files' Ballerina.toml Dependencies.toml"
}
}
}
}

publishing {
publications {
maven(MavenPublication) {
artifact source: createArtifactZip, extension: 'zip'
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ballerina-platform/module-${packageOrg}-${packageName}")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}

clean {
delete 'build'
}

build.dependsOn "generatePomFileForMavenPublication"
publishToMavenLocal.dependsOn build
publish.dependsOn build
15 changes: 15 additions & 0 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
//
// WSO2 LLC. licenses this file to you 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.
Binary file added ballerina/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
distribution = "2201.8.6"
org = "ballerinax"
name = "asana"
version = "@toml.version@"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["Asana", "Productivity/Project Management", "Cost/Freemium", "Task Management"]
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-asana"

[build-options]
observabilityIncluded = true
Loading