Skip to content
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
33 changes: 5 additions & 28 deletions .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,8 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 21.0.3
- name: Change to Timestamped Version
run: |
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00')
latestCommit=$(git log -n 1 --pretty=format:"%h")
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)
updatedVersion=$VERSION-$startTime-$latestCommit
echo $updatedVersion
sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
nexusUser: ${{ secrets.NEXUS_USERNAME }}
nexusPassword: ${{ secrets.NEXUS_PASSWORD }}
run: |
./gradlew clean build publish --stacktrace --scan --console=plain
call_workflow:
name: Run Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main
secrets: inherit
49 changes: 9 additions & 40 deletions .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
name: Publish to the Ballerina central
name: Publish to the Ballerina Dev/Stage central

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

jobs:
publish-release:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 21.0.3
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Ballerina Central Dev Push
if: ${{ github.event.inputs.environment == 'DEV CENTRAL' }}
env:
BALLERINA_DEV_CENTRAL: true
BALLERINA_STAGE_CENTRAL: false
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build -PpublishToCentral=true

- name: Ballerina Central Stage Push
if: ${{ github.event.inputs.environment == 'STAGE CENTRAL' }}
env:
BALLERINA_DEV_CENTRAL: false
BALLERINA_STAGE_CENTRAL: true
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build -PpublishToCentral=true
call_workflow:
name: Run Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
14 changes: 14 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish release

on:
workflow_dispatch:

jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main
secrets: inherit
with:
package-name: xsdtool
package-org: ballerina
9 changes: 9 additions & 0 deletions build-config/resources/BalTool.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool]
id = "xsd"

[[dependency]]
path = "../xsd-core/build/libs/xsd-cli-@project.version@.jar"

[[dependency]]
path = "../xsd-core/build/libs/xsd-core-@project.version@.jar"

9 changes: 0 additions & 9 deletions build-config/resources/package/BalTool.toml

This file was deleted.

61 changes: 24 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,11 @@ 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/groups/wso2-public/'
}

maven {
url = 'https://maven.wso2.org/nexus/content/repositories/orgballerinalang-1614'
}
mavenCentral()

maven {
url = 'https://repo.maven.apache.org/maven2'
Expand All @@ -54,46 +44,43 @@ allprojects {
password System.getenv("packagePAT")
}
}

maven {
url "https://plugins.gradle.org/m2/"
}
}

ext {
snapshotVersion= '-SNAPSHOT'
snapshotVersion = '-SNAPSHOT'
timestampedVersionRegex = '.*-\\d{8}-\\d{6}-\\w.*\$'
}
}

subprojects {
configurations {
ballerinaStdLibs
jbalTools
}

dependencies {
/* JBallerina Tools */
jbalTools("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") {
transitive = false
}
}
}

tasks.register('build') {
dependsOn(":xsd-cli:build")
dependsOn(":xsd-core:build")
dependsOn(":module-ballerina-xsd:build")
}

def moduleVersion = project.version.replace("-SNAPSHOT", "")

release {
failOnPublishNeeded = false
failOnSnapshotDependencies = true

buildTasks = ['build']
failOnSnapshotDependencies = true
versionPropertyFile = 'gradle.properties'
tagTemplate = 'v$version'

tagTemplate = 'v${version}'
git {
requireBranch = "release-${moduleVersion}"
pushToRemote = 'origin'
}
}

tasks.register('clean') {
dependsOn(":module-ballerina-xsd:clean")
}

tasks.register('build') {
dependsOn(":module-ballerina-xsd:build")
}

tasks.register('test') {
dependsOn(":module-ballerina-xsd:test")
dependsOn(":xsd-core:test")
}

publishToMavenLocal.dependsOn build
publish.dependsOn build
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.caching=true
group=io.ballerina
version=0.1.0-SNAPSHOT
version=1.0.0-SNAPSHOT

# Dependencies
ballerinaLangVersion=2201.11.0
Expand All @@ -9,6 +9,7 @@ spotbugsPluginVersion=6.0.18
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
ballerinaGradlePluginVersion=2.3.0

xsd4jVersion=1.6.3
apacheXmlSchemaVersion=1.4.7
Expand Down
4 changes: 2 additions & 2 deletions module-ballerina-xsd/BalTool.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
id = "xsd"

[[dependency]]
path = "lib/xsd-cli-0.1.0-SNAPSHOT.jar"
path = "../xsd-core/build/libs/xsd-cli-1.0.0-SNAPSHOT.jar"

[[dependency]]
path = "lib/xsd-core-0.1.0-SNAPSHOT.jar"
path = "../xsd-core/build/libs/xsd-core-1.0.0-SNAPSHOT.jar"

2 changes: 1 addition & 1 deletion module-ballerina-xsd/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
distribution = "2201.11.0"
org = "ballerina"
name = "xsdtool"
version = "0.1.0"
version = "1.0.0"
authors = ["Ballerina"]
keywords = ["xsd", "xsd-tool"]
repository = "https://github.com/ballerina-platform/xsd-tools"
Expand Down
2 changes: 1 addition & 1 deletion module-ballerina-xsd/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.11.0"
[[package]]
org = "ballerina"
name = "xsdtool"
version = "0.1.0"
version = "1.0.0"
modules = [
{org = "ballerina", packageName = "xsdtool", moduleName = "xsdtool"}
]
Expand Down
Loading