v1.14.2 #66
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Java Agent | |
on: | |
release: | |
types: [ created, edited ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == 'HXSecurity/DongTai-agent-java' | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Set up Maven | |
uses: stCarolas/setup-maven@v4 | |
with: | |
maven-version: 3.2.5 | |
- id: release | |
run: | | |
TAG_NAME=${{ github.event.release.tag_name }} | |
ID=`echo ${TAG_NAME##v}` | |
echo "::set-output name=VERSION::$ID" | |
- name: Build and Publish Maven Package | |
run: | | |
bash .github/workflows/scripts/version_update.sh "${{ steps.release.outputs.VERSION }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate version file | |
run: | | |
cd ${{ github.workspace }}/dongtai-agent/src/main/resources/bin/ && \ | |
echo "${{ github.event.repository.name }},version,${{ steps.release.outputs.VERSION }}" >> version.txt && \ | |
echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> version.txt && \ | |
files=('dongtai-core.jar') && \ | |
for FILE in ${files[@]};do FILE_HASH=`sha256sum ${FILE} | awk '{print $1}'`; echo "${{ github.event.repository.name }},${FILE},${FILE_HASH}" >> version.txt; done \ | |
- name: Upload COS 1 | |
if: ${{ steps.version.outputs.GITHUB_REF }} == develop | |
uses: zkqiang/tencent-cos-action@v0.1.0 | |
with: | |
args: upload -rs dongtai-agent/src/main/resources/bin/version.txt /iast/release-version/${{ github.event.repository.name }}/${{ steps.release.outputs.VERSION }}/version.txt | |
secret_id: ${{ secrets.TENSECRET_ID }} | |
secret_key: ${{ secrets.TENSECRET_KEY }} | |
bucket: dongtai-helm-charts-1251882848 | |
region: ap-hongkong | |
- name: Upload COS 2 | |
uses: zkqiang/tencent-cos-action@v0.1.0 | |
with: | |
args: upload -rs dongtai-agent/target/dongtai-agent.jar /agent/java/latest/dongtai-agent.jar && upload -rs dongtai-agent/src/main/resources/bin/ /agent/java/latest/ | |
secret_id: ${{ secrets.TENSECRET_ID }} | |
secret_key: ${{ secrets.TENSECRET_KEY }} | |
bucket: dongtai-helm-charts-1251882848 | |
region: ap-hongkong | |
- name: Upload COS 3 | |
uses: zkqiang/tencent-cos-action@v0.1.0 | |
with: | |
args: upload -rs dongtai-agent/target/dongtai-agent.jar /agent/java/${{ steps.release.outputs.VERSION }}/dongtai-agent.jar && upload -rs dongtai-agent/src/main/resources/bin/ /agent/java/${{ steps.release.outputs.VERSION }}/ | |
secret_id: ${{ secrets.TENSECRET_ID }} | |
secret_key: ${{ secrets.TENSECRET_KEY }} | |
bucket: dongtai-helm-charts-1251882848 | |
region: ap-hongkong |