Skip to content
Merged

bump #84

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
24 changes: 24 additions & 0 deletions .github/actions/commit-info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Retrieve commit info
description: Retrieve commit info
runs:
using: "composite"
steps:
- shell: bash
run: |
if [[ "$GITHUB_REF_NAME" != "master" && "$GITHUB_REF_NAME" != "main" ]]; then
SAFE_BRANCH_NAME=$(echo "$GITHUB_REF_NAME" | tr '/' '-')
SAFE_BRANCH_NAME=$(echo "$SAFE_BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]//g')
BRANCH_SUFFIX="-$SAFE_BRANCH_NAME"
else
BRANCH_SUFFIX=""
fi
echo "BRANCH_SUFFIX=$BRANCH_SUFFIX" >> $GITHUB_ENV

COMMIT_NUMBER=$(git rev-list HEAD --count)
echo "COMMIT_NUMBER=$COMMIT_NUMBER" >> $GITHUB_ENV

SHA_7=${GITHUB_SHA::7}
echo "SHA_7=$SHA_7" >> $GITHUB_ENV

REVISION="1.${COMMIT_NUMBER}-${SHA_7}${BRANCH_SUFFIX}"
echo "REVISION=$REVISION" >> $GITHUB_ENV
1 change: 0 additions & 1 deletion .github/workflows/maven-library-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ jobs:

- name: Upload code coverage
uses: codecov/codecov-action@v4

5 changes: 4 additions & 1 deletion .github/workflows/maven-service-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ jobs:

scan:
name: Scan with Trivy
needs: build
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Trivy CLI
run: |
wget https://github.com/aquasecurity/trivy/releases/download/v0.39.1/trivy_0.39.1_Linux-64bit.deb
sudo dpkg -i trivy_0.39.1_Linux-64bit.deb

- uses: actions/download-artifact@v4
with:
name: bom.json

- name: Run Trivy with SBOM
run: trivy sbom --severity CRITICAL,HIGH --format sarif -o trivy-report.sarif ./bom.json

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/maven-service-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
SLACK_COLOR: ${{ job.status }}
SLACK_LINK_NAMES: true
SLACK_FOOTER: ""

test-coverage:
if: ${{ !inputs.ignore-coverage }}
runs-on: ubuntu-22.04
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/maven-swag-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ jobs:

- name: Build client jar
run: mvn --batch-mode clean package -f pom.xml -P="client"

38 changes: 20 additions & 18 deletions .github/workflows/maven-swag-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ on:
required: false
default: "web_deploy"
type: string
java-version:
description: 'Java version'
required: false
default: "15"
type: string
java-distribution:
description: 'Java distribution'
required: false
default: "adopt"
type: string
secrets:
server-username:
required: true
Expand Down Expand Up @@ -75,23 +85,19 @@ jobs:
path: ${{ inputs.dist-directory }}

- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
uses: ./.github/actions/commit-info

- name: Set artifact version
run: |
mvn versions:set versions:commit -DnewVersion="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}-server"

- name: Deploy server package
- name: Deploy package
uses: valitydev/[email protected]
with:
jdk-version: ${{ inputs.java-version }}
jdk-distribution: ${{ inputs.java-distribution }}
server-username: ${{ secrets.server-username }}
server-password: ${{ secrets.server-password }}
deploy-secret-key: ${{ secrets.deploy-secret-key }}
deploy-secret-key-password: ${{ secrets.deploy-secret-key-password }}
maven-args: '-Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}-server" -P="server"'
maven-args: '-Dcommit.number=${{ env.COMMIT_NUMBER }} -Drevision=${{ env.REVISION }}-server" -P="server"'

deploy-client:
runs-on: ubuntu-22.04
Expand All @@ -109,23 +115,19 @@ jobs:
path: ${{ inputs.dist-directory }}

- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
uses: ./.github/actions/commit-info

- name: Set artifact version
run: |
mvn --batch-mode versions:set versions:commit -DnewVersion="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}-client"

- name: Deploy client package
- name: Deploy package
uses: valitydev/[email protected]
with:
jdk-version: ${{ inputs.java-version }}
jdk-distribution: ${{ inputs.java-distribution }}
server-username: ${{ secrets.server-username }}
server-password: ${{ secrets.server-password }}
deploy-secret-key: ${{ secrets.deploy-secret-key }}
deploy-secret-key-password: ${{ secrets.deploy-secret-key-password }}
maven-args: '-Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}-client" -P="client"'
maven-args: '-Dcommit.number=${{ env.COMMIT_NUMBER }} -Drevision=${{ env.REVISION }}-client" -P="client"'

success-notify:
runs-on: ubuntu-22.04
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/maven-thrift-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install thrift
uses: valitydev/[email protected]
uses: valitydev/[email protected]

- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Maven
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}
cache: 'maven'
- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
- name: Build package
run: mvn --batch-mode -Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}" clean compile -f pom.xml

- name: Build packages
run: mvn -B clean verify
14 changes: 8 additions & 6 deletions .github/workflows/maven-thrift-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install thrift
uses: valitydev/[email protected]
uses: valitydev/[email protected]

- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
uses: ./.github/actions/commit-info

- name: Deploy package
uses: valitydev/[email protected]
with:
jdk-version: ${{ inputs.java-version }}
java-distribution: ${{ inputs.java-distribution }}
jdk-distribution: ${{ inputs.java-distribution }}
server-username: ${{ secrets.server-username }}
server-password: ${{ secrets.server-password }}
deploy-secret-key: ${{ secrets.deploy-secret-key }}
deploy-secret-key-password: ${{ secrets.deploy-secret-key-password }}
maven-args: '-Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}"'
maven-args: '-Dcommit.number=${{ env.COMMIT_NUMBER }} -Drevision=${{ env.REVISION }}'

notify:
runs-on: ubuntu-22.04
needs: [deploy]
Expand Down