ci: Remove release and selfhost

This commit is contained in:
qianmoQ 2022-10-12 10:03:26 +08:00
parent c4152e7f9e
commit b39951dd20
2 changed files with 0 additions and 148 deletions

View File

@ -1,103 +0,0 @@
name: Publish New Release
on:
pull_request:
branch:
- 'master'
types: [ closed ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Read release version
id: package-version
run: |
VAR=$(./mvnw -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.help=INFO | tail -1)
echo "::set-output name=version::$VAR"
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ steps.package-version.outputs.version }}
release_name: ${{ steps.package-version.outputs.version }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.package-version.outputs.version }}
before_checker_loading:
runs-on: ubuntu-latest
needs:
- release
steps:
- name: Checkout
uses: actions/checkout@v3
- run: echo 'Before checker loading'
before_checker_style:
runs-on: ubuntu-latest
needs:
- before_checker_loading
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Maven Checker Style
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- run: chmod 755 ./mvnw
- run: ./mvnw clean install checkstyle:checkstyle -Dfindbugs.skip -Dgpg.skip -Dskip.npm -DskipTests=true
before_checker_bugs:
runs-on: ubuntu-latest
needs:
- before_checker_loading
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Maven Checker Bugs
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- run: chmod 755 ./mvnw
- run: ./mvnw clean install findbugs:findbugs -Dcheckstyle.skip -Dgpg.skip -Dskip.npm -DskipTests=true
publish:
runs-on: ubuntu-latest
needs:
- release
- before_checker_loading
- before_checker_style
- before_checker_bugs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Maven Checker Package
- run: |
chmod 755 ./mvnw
wget -O /tmp/jdk-8u60-linux-x64.tar.gz http://software.cdn.ttxit.com/oracle/jdk-8u60-linux-x64.tar.gz
mkdir -p /opt/java/
tar -xzf /tmp/jdk-8u60-linux-x64.tar.gz -C /opt/java/
export JAVA_HOME=/opt/java/jdk1.8.0_60
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/bin/dt.jar:$JAVA_HOME/lib/tools.jar
java -version
./mvnw clean install package -Dfindbugs.skip -Dgpg.skip -Dcheckstyle.skip -DskipTests=true
- name: Upload Release Asset
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./dist/datacap-release.tar.gz
asset_name: datacap-${{ needs.release.outputs.version }}-release.tar.gz
asset_content_type: application/x-gzip

View File

@ -1,45 +0,0 @@
name: Publish Self Host
on: [push]
jobs:
publish_package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Chmod
run: chmod 755 ./mvnw
- name: Package
run: |
wget -O /tmp/jdk-8u60-linux-x64.tar.gz http://software.cdn.ttxit.com/oracle/jdk-8u60-linux-x64.tar.gz
mkdir -p /opt/java/
tar -xzf /tmp/jdk-8u60-linux-x64.tar.gz -C /opt/java/
export JAVA_HOME=/opt/java/jdk1.8.0_60
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/bin/dt.jar:$JAVA_HOME/lib/tools.jar
java -version
./mvnw clean install package -Dfindbugs.skip -Dgpg.skip -Dcheckstyle.skip -DskipTests=true
- name: Upload
uses: AEnterprise/rsync-deploy@v1.0
env:
DEPLOY_KEY: ${{ secrets.SERVER_PRIVATE_KEY }}
ARGS: -avz --delete --exclude='*.pyc'
SERVER_PORT: '22'
FOLDER: dist/datacap-release.tar.gz
SERVER_IP: ${{ secrets.SERVER_HOST }}
USERNAME: ${{ secrets.SERVER_USER_NAME }}
SERVER_DESTINATION: /root/app/
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER_NAME }}
key: ${{ secrets.SERVER_PRIVATE_KEY }}
script: |
cd /root/app && cd datacap && sh ./bin/shutdown.sh
cd /root/app && rm -rf datacap
cd /root/app && tar -xvzf datacap-release.tar.gz
cd /root/app && chmod -R 777 datacap
cd /root/app && cd datacap && sh ./bin/shutdown.sh && sh ./bin/startup.sh
cd /root/app && rm -rf datacap-release.tar.gz