mirror of
https://github.com/valitydev/java-workflow.git
synced 2024-11-06 01:25:18 +00:00
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
name: Maven Deploy Artifact
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
java-version:
|
|
description: 'Java version'
|
|
required: false
|
|
default: "17"
|
|
type: string
|
|
java-distribution:
|
|
description: 'Java distribution'
|
|
required: false
|
|
default: "temurin"
|
|
type: string
|
|
secrets:
|
|
server-username:
|
|
required: true
|
|
server-password:
|
|
required: true
|
|
deploy-secret-key:
|
|
required: true
|
|
deploy-secret-key-password:
|
|
required: true
|
|
mm-webhook-url:
|
|
required: true
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Install thrift
|
|
uses: valitydev/action-setup-thrift@v1.0.3
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
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
|
|
- name: Deploy package
|
|
uses: valitydev/action-deploy-jdk-package@v1.0.18
|
|
with:
|
|
jdk-version: ${{ inputs.java-version }}
|
|
java-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 }}"'
|
|
notify:
|
|
runs-on: ubuntu-20.04
|
|
needs: [deploy]
|
|
steps:
|
|
- name: Mattermost Notification
|
|
uses: rtCamp/action-slack-notify@v2.2.0
|
|
env:
|
|
SLACK_USERNAME: ${{ github.event.repository.name }}
|
|
SLACK_WEBHOOK: ${{ secrets.mm-webhook-url }}
|
|
SLACK_COLOR: ${{ job.status }}
|
|
SLACK_LINK_NAMES: true
|
|
SLACK_FOOTER: ""
|