Skip to content

Commit 2bd5dd5

Browse files
committed
IJMP-1873 Kotlin SDK docs update + license header update + GitHub Actions build workflow
Signed-off-by: Uladzislau <[email protected]>
1 parent 8dabecf commit 2bd5dd5

File tree

138 files changed

+1692
-267
lines changed

Some content is hidden

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

138 files changed

+1692
-267
lines changed

.github/actions/setup/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
using: "composite"
1212
steps:
1313
- name: Set up JDK ${{ inputs.jdkVersion }}
14-
uses: actions/setup-java@v2
14+
uses: actions/setup-java@v4
1515
with:
1616
distribution: 'zulu'
1717
java-version: ${{ inputs.jdkVersion }}
@@ -21,7 +21,7 @@ runs:
2121
shell: bash
2222

2323
- name: Cache Gradle packages
24-
uses: actions/cache@v2
24+
uses: actions/cache@v4
2525
with:
2626
path: |
2727
~/.gradle/caches

.github/workflows/build.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build + Test + Sonar
2+
3+
on: [push, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build_and_test:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 40
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.head_ref }}
17+
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
18+
19+
- uses: ./.github/actions/setup
20+
21+
- name: Build with Gradle
22+
run: ./gradlew build
23+
24+
- name: Prepare lib Artifact
25+
id: artifact
26+
shell: bash
27+
run: |
28+
cd ${{ github.workspace }}/build/libs
29+
FILENAME=`ls | grep -vE '(-javadoc|-sources)\.jar$'`
30+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
31+
echo "zip artifact name:"
32+
echo "$FILENAME"
33+
34+
- name: Publish built lib to artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: ${{ steps.artifact.outputs.filename }}
38+
path: ./build/libs/*
39+
40+
- name: Test with Gradle
41+
run: ./gradlew test
42+
43+
- name: Publish tests result to artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: tests-report-${{ steps.artifact.outputs.filename }}
47+
path: ${{ github.workspace }}/build/reports/*
48+
49+
- name: Publish results to SonarCloud
50+
run: >
51+
./gradlew --info sonar -Dresults="build/reports/tests/test,build/test-results"
52+
-Psonar.host.url=$SONAR_HOST_URL -Dsonar.token=$SONAR_TOKEN
53+
-Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_PASSWORD
54+
-Dsonar.coverage.jacoco.xmlReportPaths="build/reports/jacoco.xml"
55+
env:
56+
ARTIFACTORY_USE RNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
57+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
58+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
59+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- uses: ./.github/actions/teardown

.github/workflows/release-new-version.yml

+101-15
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,107 @@
22
name: Release new binary version manually
33

44
on:
5-
# push:
6-
# branches: [ main ]
7-
# pull_request:
8-
# branches: [ main ]
95
workflow_dispatch:
106

117
jobs:
8+
changelog-and-preparations:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
steps:
14+
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
19+
20+
- uses: ./.github/actions/setup
21+
22+
- name: Fetch Gradle properties
23+
id: properties
24+
shell: bash
25+
run: |
26+
PROPERTIES="$(./gradlew properties --console=plain -q)"
27+
VERSION_FULL="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
28+
CURR_COMMIT="$(git rev-parse HEAD)"
29+
30+
echo "versionSemVer: $VERSION_FULL"
31+
echo "currCommit: $CURR_COMMIT"
32+
33+
echo "versionSemVer=$VERSION_FULL" >> $GITHUB_OUTPUT
34+
echo "currCommit=$CURR_COMMIT" >> $GITHUB_OUTPUT
35+
36+
- name: Prepare changelog
37+
shell: bash
38+
run: ./gradlew patchChangelog
39+
40+
- name: Prepare release notes
41+
id: release_notes
42+
shell: bash
43+
run: |
44+
CHANGELOG="$(./gradlew getChangelog -q)"
45+
46+
echo 'version_release_notes<<EOF' >> $GITHUB_OUTPUT
47+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
48+
echo 'EOF' >> $GITHUB_OUTPUT
49+
50+
echo "Release notes to be added:"
51+
echo "$CHANGELOG"
52+
53+
- name: Create new tag and release
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: |
57+
git tag ${{ steps.properties.outputs.versionSemVer }}
58+
git push origin ${{ steps.properties.outputs.versionSemVer }}
59+
gh release create ${{ steps.properties.outputs.versionSemVer }} --title ${{ steps.properties.outputs.versionSemVer }} --target ${{ steps.properties.outputs.currCommit }} -F- <<EOF
60+
${{ steps.release_notes.outputs.version_release_notes }}
61+
EOF
62+
63+
- name: Upload Release Built Artifact
64+
continue-on-error: true
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
run: gh release upload ${{ steps.properties.outputs.versionSemVer }} ./build/distributions/*
68+
69+
- uses: ./.github/actions/teardown
70+
71+
- name: Bump version in gradle.properties
72+
run: |
73+
# Read current version in gradle.properties
74+
current_version=$(grep -E "^version=" gradle.properties | cut -d'=' -f2)
75+
echo "Current version: $current_version"
76+
77+
# Splitting the prefix and the last number
78+
prefix=$(echo "$current_version" | sed 's/[0-9]*$//') # Leave prefix without the last number
79+
last_number=$(echo "$current_version" | grep -oE '[0-9]+$') # Fetching the number
80+
new_number=$((last_number + 1))
81+
new_version="${prefix}${new_number}"
82+
83+
echo "New version: $new_version"
84+
85+
# Update version in gradle.properties
86+
sed -i "s/^version=.*/version=${new_version}/" gradle.properties
87+
88+
echo "gradle.properties after change:"
89+
cat gradle.properties
90+
91+
- name: Close Milestone
92+
continue-on-error: true
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
run: |
96+
gh api repos/{owner}/{repo}/milestones \
97+
--jq '.[] | select(.title == "${{ steps.properties.outputs.versionSemVer }}") | .number' \
98+
| xargs -I '{}' gh api -X PATCH repos/{owner}/{repo}/milestones/{} -F state='closed'
99+
12100
release:
13101
runs-on: ubuntu-latest
14102
timeout-minutes: 40
15103

16104
steps:
17-
- uses: actions/checkout@v3
105+
- uses: actions/checkout@v4
18106
with:
19107
ref: ${{ github.head_ref }}
20108
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
@@ -33,13 +121,11 @@ jobs:
33121
- name: Set name
34122
run: git config user.name "For Mainframe"
35123

36-
- name: Release with Gradle automatic
37-
run: ./gradlew release -x test -x updateVersion -x commitNewVersion -Prelease.useAutomaticVersion=true -Prelease.scope=${{ github.event.inputs.scope || env.DEFAULT_SCOPE }} -Pzowe.deploy.username=$ARTIFACTORY_USERNAME -Pzowe.deploy.password=$ARTIFACTORY_PASSWORD -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_USERNAME
38-
env:
39-
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
40-
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
41-
DEFAULT_SCOPE: 'patch'
42-
BUILD_NUMBER: ${{ github.run_number }}
43-
BRANCH_NAME: ${{ github.ref_name }}
44-
45-
- uses: ./.github/actions/teardown
124+
# - name: Release with Gradle automatic
125+
# run: ./gradlew release -x test -x updateVersion -x commitNewVersion -Prelease.useAutomaticVersion=true -Prelease.scope=${{ github.event.inputs.scope || env.DEFAULT_SCOPE }} -Pzowe.deploy.username=$ARTIFACTORY_USERNAME -Pzowe.deploy.password=$ARTIFACTORY_PASSWORD -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_USERNAME
126+
# env:
127+
# ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
128+
# ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
129+
# DEFAULT_SCOPE: 'patch'
130+
# BUILD_NUMBER: ${{ github.run_number }}
131+
# BRANCH_NAME: ${{ github.ref_name }}

.github/workflows/sonar-scan.yml

-38
This file was deleted.

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
_site
2+
.sass-cache
3+
.jekyll-cache
4+
.jekyll-metadata
5+
vendor
6+
.idea
17
.idea/*.xml
28
.idea/*.iml
39
.idea/modules

CHANGELOG.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
# Zowe Client Kotlin SDK Changelog
22

3-
All notable changes to the Zowe Kotlin SDK will be documented in this file.
3+
All notable changes to the Zowe Client Kotlin SDK will be documented in this file.
44

5-
## `0.4.0 (2023-03-07)`
5+
## [Unreleased]
6+
7+
### Features
8+
9+
* Feature: Added BYTES, KILOBYTES and MEGABYTES to Dataset class ([7f0d087a](https://github.com/zowe/zowe-client-kotlin-sdk/commit/7f0d087a))
10+
* Feature: Added "failOnPrompt" parameter to the "issueTsoCommand" function ([b6903eb5](https://github.com/zowe/zowe-client-kotlin-sdk/commit/b6903eb5))
11+
* Feature: Added responses validator ([c659e038](https://github.com/zowe/zowe-client-kotlin-sdk/commit/c659e038))
12+
* Feature: Migrated "build.gradle" to "build.gradle.kts" ([f9eefc83](https://github.com/zowe/zowe-client-kotlin-sdk/commit/f9eefc83))
13+
* Feature: Added "saveNewSecureProperties" function ([7c81c2a6](https://github.com/zowe/zowe-client-kotlin-sdk/commit/7c81c2a6))
14+
* Feature: Added "executeTsoCommand" function to TsoApi ([c7fcb97b](https://github.com/zowe/zowe-client-kotlin-sdk/commit/c7fcb97b))
15+
* Feature: Added parsing of nested profiles of Zowe Team Config v2 ([3ce259b8](https://github.com/zowe/zowe-client-kotlin-sdk/commit/3ce259b8))
16+
17+
### Bugfixes
18+
19+
* Bugfix: Fix for Windows credentials store ([4db02f88](https://github.com/zowe/zowe-client-kotlin-sdk/commit/4db02f88))
20+
21+
## [0.4.0] (2023-03-07)
22+
23+
### Features
624

725
* Feature: GitHub issue #3: Zowe Kotlin SDK: Java-like Kotlin API ([56788c1a](https://github.com/zowe/zowe-client-kotlin-sdk/commit/56788c1a))
826
* Feature: Implement ZosUssFile (copying methods - from uss to dsn and to uss folder) ([2bb0b257](https://github.com/zowe/zowe-client-kotlin-sdk/commit/2bb0b257))
927

28+
### Bugfixes
1029

1130
* Bugfix: GitHub issue #9: Error Creating Connection ([bbc16d72](https://github.com/zowe/zowe-client-kotlin-sdk/commit/bbc16d72))

0 commit comments

Comments
 (0)