diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9022fb41 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + pull_request: + branches: + - dev + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + jdk-version: + - 17 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "adopt" + java-version: ${{ matrix.jdk-version }} + cache: "maven" + - name: Compile + run: | + sed -i.bak '//,/<\/repositories>/d' pom.xml + sed -i.bak '//,/<\/pluginRepositories>/d' pom.xml + mvn -B compile --file pom.xml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 19a1ea17..6646735a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,17 +13,20 @@ jobs: steps: # 1、检出源码 - name: Checkout - uses: actions/checkout@master + uses: actions/checkout@v4 # 2、安装 Java 环境 - name: Setup Java - uses: actions/setup-java@master + uses: actions/setup-java@v4 with: - distribution: 'adopt' + distribution: "adopt" java-version: 17 - cache: 'maven' + cache: "maven" # 3、打包 - name: Build - run: mvn -B package --file pom.xml + run: | + sed -i.bak '//,/<\/repositories>/d' pom.xml + sed -i.bak '//,/<\/pluginRepositories>/d' pom.xml + mvn -B package --file pom.xml # 4、拷贝到服务器 - name: Copy uses: garygrossgarten/github-action-scp@release @@ -46,33 +49,3 @@ jobs: cd /docker docker-compose up --force-recreate --build -d continew-admin-server docker images | grep none | awk '{print $3}' | xargs docker rmi - # Sonar 扫描 - sonar-scan: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - with: - fetch-depth: 0 - - name: Setup Java - uses: actions/setup-java@master - with: - distribution: 'adopt' - java-version: 17 - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Analyze - run: mvn -B verify -Psonar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 64602a5c..7156f47e 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - 'v*' # Push events to matching v*, i.e. v1.0.0 + - "v*" # Push events to matching v*, i.e. v1.0.0 jobs: release: @@ -20,4 +20,4 @@ jobs: with: tag_name: ${{ github.ref }} body: | - 详情请参阅 [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/dev/CHANGELOG.md) 。 \ No newline at end of file + 详情请参阅 [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/dev/CHANGELOG.md) 。 diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml new file mode 100644 index 00000000..9f5a1d82 --- /dev/null +++ b/.github/workflows/scan.yml @@ -0,0 +1,48 @@ +name: Scan + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + +jobs: + sonar-scan: + runs-on: ubuntu-latest + strategy: + matrix: + jdk-version: + - 17 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "adopt" + java-version: ${{ matrix.jdk-version }} + cache: "maven" + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Analyze + run: | + sed -i.bak '//,/<\/repositories>/d' pom.xml + sed -i.bak '//,/<\/pluginRepositories>/d' pom.xml + mvn -B verify -Psonar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/continew-admin-generator/src/main/java/top/continew/admin/generator/enums/FormTypeEnum.java b/continew-admin-generator/src/main/java/top/continew/admin/generator/enums/FormTypeEnum.java index 22867c3f..61e90de8 100644 --- a/continew-admin-generator/src/main/java/top/continew/admin/generator/enums/FormTypeEnum.java +++ b/continew-admin-generator/src/main/java/top/continew/admin/generator/enums/FormTypeEnum.java @@ -84,9 +84,8 @@ public enum FormTypeEnum implements IBaseEnum { /** * 树形选择 */ - TREE_SELECT(11, "树选择"), - ; - + TREE_SELECT(11, "树选择"),; + private final Integer value; private final String description; }