Skip to content

Commit

Permalink
Merge branch 'feature/AntiMage' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Jan 12, 2024
2 parents d496a92 + a707a1b commit 2a91f6c
Show file tree
Hide file tree
Showing 305 changed files with 3,380 additions and 1,142 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Release-To-OssRh
run-name: Deploy ${{github.event.release.tag_name}} to Sonatype by @${{ github.actor }}

on:
workflow_dispatch:
inputs:
testCoverReport:
description: 'test and coveralls report?'
default: true
type: boolean
required: false
testFailureIgnore:
description: 'test failure.ignore?'
default: false
type: boolean
required: false
testLoggerLevel:
description: 'test logger level'
default: WARN
type: choice
options:
- DEBUG
- INFO
- WARN
- ERROR
required: false
release:
types: [published]

jobs:
release:
name: Release to Sonatype
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2g
LOG_LEVEL: ${{ inputs.testLoggerLevel }}
WINGS_HOME: ${{ github.workspace }}

steps:
- name: Checkout ${{github.event.release.tag_name}}
uses: actions/checkout@v4
## chache asdf/, m2/repository
- name: Cache Sdk & Repo
id: cache-sdk-repo
uses: actions/cache@v3
with:
path: |
~/.asdf/
~/.m2/repository/
key: asdf-m2-repo-${{hashFiles('.tool-versions')}}

## install jdk and maven
- name: Install asdf & tools
uses: asdf-vm/actions/install@v2
with:
skip_install: ${{steps.cache-sdk-repo.outputs.cache-hit == 'true'}}

## write settings.xml
- name: Maven settings.xml
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << "EOF"
<settings>
<interactiveMode>false</interactiveMode>
<servers>
<server>
<id>ossrh</id>
<username>${MVN_OSS_USER}</username>
<password>${MVN_OSS_PASS}</password>
</server>
</servers>
</settings>
EOF
## get JAVA_HOME
- name: Env JAVA_HOME
id: java-env
run: echo "JAVA_HOME=$(asdf where java)" >> "$GITHUB_OUTPUT"
## get revision if release
- name: Opt revision
id: opt-revision
if: github.event.release.tag_name != ''
run: echo "OPT_REVISION=-Drevision=${{github.event.release.tag_name}}" >> "$GITHUB_OUTPUT"
## info deploy
- name: Info Deploy
run: |
mvn --quiet --non-recursive -DforceStdout -Dexpression=project.version ${{ steps.opt-revision.outputs.OPT_REVISION }} help:evaluate
echo
mvn -v
git --no-pager log --graph -10 --pretty=format:'%H - %an, %ad %d : %s'
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
## ci report if not release
- name: Coveralls Report
if: inputs.testCoverReport
run: >
mvn
-P ci
--quiet
-Duser.timezone=Asia/Shanghai
-Dtesting-json='{
"debug":"${{ inputs.testLoggerLevel == 'DEBUG' }}",
"test-verbose":"${{ inputs.testLoggerLevel == 'DEBUG' }}",
"sentry.logging.enabled":"${{ inputs.testLoggerLevel == 'DEBUG' }}",
"spring.wings.silencer.enabled.verbose":"${{ inputs.testLoggerLevel == 'DEBUG' }}",
"logging.level.root":"${{ inputs.testLoggerLevel }}",
"logging.level.org.springframework.web":"${{ inputs.testLoggerLevel }}",
"logging.level.org.jooq":"${{ inputs.testLoggerLevel }}"
}'
-Dmaven.test.failure.ignore=${{ inputs.testFailureIgnore }}
-DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }}
clean test jacoco:report coveralls:report
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
## import gpp private key
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MVN_GPG_SKEY }}
passphrase: ${{ secrets.MVN_GPG_PASS }}
## maven deploy
- name: Maven Deploy
run: >
mvn
-P ossrh
${{ steps.opt-revision.outputs.OPT_REVISION }}
-Dgpg.passphrase=${MVN_GPG_PASS}
clean deploy
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
MVN_OSS_USER: ${{ secrets.MVN_OSS_USER }}
MVN_OSS_PASS: ${{ secrets.MVN_OSS_PASS }}
MVN_GPG_PASS: ${{ secrets.MVN_GPG_PASS }}
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
java temurin-21.0.1+12.0.LTS
maven 3.9.6
14 changes: 7 additions & 7 deletions example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>pro.fessional</groupId>
<artifactId>wings</artifactId>
<version>${revision}.${changelist}</version>
<version>${revision}</version>
<relativePath>../wings/pom.xml</relativePath>
</parent>

<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<packaging>pom</packaging>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>

<name>Example::</name>
<description>Sample and Template</description>
Expand Down Expand Up @@ -42,27 +42,27 @@
<dependency>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>winx-admin</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>winx-front</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>winx-codegen</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>winx-common</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>winx-devops</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion example/winx-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-admin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example/winx-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example/winx-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-codegen</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example/winx-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.datasource.url=jdbc:mysql://localhost:3306/wings_example\
spring.datasource.url=jdbc:mysql://localhost:51487/wings_example\
?connectionTimeZone=%2B08:00&forceConnectionTimeZoneToSession=true\
&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true\
&characterEncoding=UTF-8&useUnicode=true
Expand Down
2 changes: 1 addition & 1 deletion example/winx-devops/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-devops</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @since 2021-02-22
*/
public interface Devops0ProjectConstant {
String JDBC_URL = "jdbc:mysql://localhost:3306/wings_example?autoReconnect=true"
String JDBC_URL = "jdbc:mysql://localhost:51487/wings_example?autoReconnect=true"
+ "&useSSL=false&allowPublicKeyRetrieval=true"
+ "&useUnicode=true&characterEncoding=UTF-8"
+ "&connectionTimeZone=%2B08:00&forceConnectionTimeZoneToSession=true";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author trydofor
* @since 2021-02-22
*/
@Disabled("Database Version")
@Disabled("Project: Database Version")
@SpringBootTest(properties = {
"spring.datasource.url=" + Devops0ProjectConstant.JDBC_URL,
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author trydofor
* @since 2021-02-22
*/
@Disabled("Code Gen")
@Disabled("Project: Code Gen")
public class Devops2CodeGeneratorTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
"spring.datasource.password=" + Devops0ProjectConstant.JDBC_PASS,
})
@Disabled("Journal Manage")
@Disabled("Project: Journal Manage")
@Slf4j
public class Devops5JournalManagerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
"spring.datasource.password=" + Devops0ProjectConstant.JDBC_PASS,
})
@Disabled("Sharding table")
@Disabled("Project: Sharding table")
public class Devops6ShardingManagerTest {

@Setter(onMethod_ = {@Autowired})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

@SpringBootTest
@Disabled("Dump Enums")
@Disabled("Project: Dump Enums")
public class Devops7EnumsDumperTest {

@Setter(onMethod_ = {@Autowired})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

@SpringBootTest
@Disabled("List Web RequestMapping")
@Disabled("Project: List Web RequestMapping")
@Slf4j
public class Devops7RequestMapperTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@SpringBootTest
@Disabled("Dump database")
@Disabled("Project: Dump database")
@Slf4j
public class Devops7SchemaDumperTest {

Expand Down
2 changes: 1 addition & 1 deletion example/winx-front/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.moilioncircle.wings</groupId>
<artifactId>example</artifactId>
<version>${revision}-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>winx-front</artifactId>
Expand Down
19 changes: 19 additions & 0 deletions observe/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3.9'
name: professional-wings
services:
mysql:
container_name: wings-mysql8
image: mysql:8.0.35
restart: unless-stopped
command:
- --disable-log-bin
environment:
MYSQL_DATABASE: 'test'
MYSQL_USER: 'trydofor'
MYSQL_PASSWORD: 'moilioncircle'
MYSQL_ROOT_PASSWORD: 'moilioncircle'
volumes:
- ./mysql/init/:/docker-entrypoint-initdb.d/
- ./mysql/conf/:/etc/mysql/conf.d/
ports:
- '51487:3306'
12 changes: 12 additions & 0 deletions observe/docker/mysql/conf/wings.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[mysqld]
authentication_policy = caching_sha2_password
max_connections = 4096
lower_case_table_names = 1
innodb_ft_min_token_size = 2
ft_min_word_len = 2
ngram_token_size = 2
character-set-server = UTF8MB4
default-time-zone = '+8:00'
log_bin_trust_function_creators = 1
innodb_file_per_table = 1
#skip_grant_tables
2 changes: 2 additions & 0 deletions observe/docker/mysql/init/1-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GRANT ALL ON `wings%`.* TO 'trydofor'@'%';
FLUSH PRIVILEGES;
Loading

0 comments on commit 2a91f6c

Please sign in to comment.