Skip to content

Commit

Permalink
Merge pull request #8 from IsuruMaduranga/main
Browse files Browse the repository at this point in the history
Add  workflows for transaction counter release
  • Loading branch information
IsuruMaduranga committed Nov 30, 2023
2 parents 3c1529b + de53a16 commit b459d62
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/counting-handler-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Transaction Counting Handler
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Checkout code
uses: actions/checkout@v4
- name: Build with Maven
working-directory: ./counter
run: mvn package --file pom.xml
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
directory: ./counter
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
49 changes: 49 additions & 0 deletions .github/workflows/counting-service-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release Transaction Counting Service
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Cache Ballerina.
uses: actions/cache@v3
id: cache
with:
path: "ballerina-dist/*.deb"
key: "ballerina-2201.8.0"
- name: Download Ballerina distribution.
shell: sh
run: |
mkdir -p ballerina-dist
wget 'https://dist.ballerina.io/downloads/2201.8.0/ballerina-2201.8.0-swan-lake-linux-x64.deb' -P ballerina-dist
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Ballerina distribution.
shell: sh
run: "sudo dpkg -i ballerina-dist/ballerina-2201.8.0-swan-lake-linux-x64.deb"
- name: Verify Ballerina Version
shell: sh
run: "bal -v"

- name: Checkout code
uses: actions/checkout@v4
- name: Build ballerina service
working-directory: ./service
run: bal build
- name: Read the version from Ballerina.toml
uses: SebRollen/toml-action@v1.0.2
id: read_toml
with:
file: 'service/Ballerina.toml'
field: 'package.version'

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/transaction-counting-service:latest
docker tag ${{ secrets.DOCKER_USERNAME }}/transaction-counting-service:latest ${{ secrets.DOCKER_USERNAME }}/transaction-counting-service:${{ steps.read_toml.outputs.value }}
docker push ${{ secrets.DOCKER_USERNAME }}/transaction-counting-service:${{ steps.read_toml.outputs.value }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.wso2.integration.transaction.counter</groupId>
<artifactId>transaction-counter</artifactId>
<packaging>pom</packaging>
<version>0.1.0-SNAPSHOT</version>
<version>0.1.0</version>
<name>WSO2 Integration Transaction Counter</name>

<modules>
Expand Down
4 changes: 2 additions & 2 deletions service/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
org = "wso2"
name = "TransactionCountingService"
version = "0.1.0-SNAPSHOT"
version = "0.1.0"
distribution = "2201.7.0"

[build-options]
observabilityIncluded = true
cloud = "k8s"
cloud = "docker"
5 changes: 1 addition & 4 deletions service/Cloud.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[container.image]
repository="wso2inc"
name="transaction-counting-service"
tag="v0.1.0-SNAPSHOT"

[settings]
buildImage=false
tag="latest"
2 changes: 1 addition & 1 deletion service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.integration.transaction.counter</groupId>
<artifactId>transaction-counter</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>0.1.0</version>
</parent>

<artifactId>transaction-count-service</artifactId>
Expand Down

0 comments on commit b459d62

Please sign in to comment.