Skip to content

Commit

Permalink
refactor: release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Yue Yang <[email protected]>
  • Loading branch information
g1eny0ung committed Dec 27, 2023
1 parent 734aa8e commit 23b5b95
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 118 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release
on:
push:
branches:
- main
tags:
- v*

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "adopt"

- name: Build with Maven
run: |
cd BytemanHelper
mvn package -Dmaven.test.skip=true
cd ..
cd ChaosAgent
mvn package -Dmaven.test.skip=true
cd ..
cd AgentInstaller
mvn package -Dmaven.test.skip=true
cd ..
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Configure awscli
run: |
pip3 install awscli
printf "%s\n" ${{ secrets.AWS_ACCESS_KEY }} ${{ secrets.AWS_SECRET_KEY }} ${{ secrets.AWS_REGION }} "json" | aws configure
- name: Package and Upload
env:
BYTEMAN_VERSION: 4.0.20
HELPER_VERSION: 0.12
VERSION: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
run: |
$BYTEMAN_DIR=byteman-download-${BYTEMAN_VERSION}
curl -fsSLO https://downloads.jboss.org/byteman/${BYTEMAN_VERSION}/${BYTEMAN_DIR}-bin.zip
unzip ${BYTEMAN_DIR}-bin.zip
cp ./BytemanHelper/target/byteman-helper-${HELPER_VERSION}.jar ./${BYTEMAN_DIR}/lib/byteman-helper.jar
cp ./AgentInstaller/target/agent-installer-${HELPER_VERSION}.jar ./${BYTEMAN_DIR}/lib/agent-installer.jar
cp ./ChaosAgent/target/chaos-agent-${HELPER_VERSION}.jar ./${BYTEMAN_DIR}/lib/chaos-agent.jar
cp ./Scripts/bminstall.sh ./${BYTEMAN_DIR}/bin/
mv ./byteman-download-${BYTEMAN_VERSION} ./byteman-chaos-mesh-download-${VERSION}
tar czvf ./byteman-chaos-mesh-download-${VERSION}.tar.gz ./byteman-chaos-mesh-download-${VERSION}
aws s3 cp ./byteman-chaos-mesh-download-${VERSION}.tar.gz ${{ secrets.AWS_BUCKET_NAME }}/byteman-chaos-mesh-download-${VERSION}.tar.gz
57 changes: 0 additions & 57 deletions .github/workflows/release_latest.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/release_tag.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
java-version: "8"
distribution: "adopt"

- name: Test with Maven
run: |
Expand Down

0 comments on commit 23b5b95

Please sign in to comment.