Skip to content

Commit 0a54563

Browse files
committed
feat(maven): refine pom for publish by action
0 parents  commit 0a54563

568 files changed

Lines changed: 30232 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/settings.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
_extends: .github
3+
4+
repository:
5+
homepage: gitee.com
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build Common-Api
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
# paths:
7+
# - "common*/**"
8+
# - ".github/workflows/build-common-api.yml"
9+
10+
concurrency:
11+
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
if: "!contains(github.event.head_commit.message, 'ci skip')"
18+
strategy:
19+
matrix:
20+
java: ["8", "11", "17"]
21+
env: # define constant
22+
PROJECT_PREFIX: common-api/
23+
steps:
24+
- name: Export Global Var
25+
# define global var, then put to GITHUB_ENV
26+
run: |
27+
echo "PROJECT_HOME=$PWD" >> $GITHUB_ENV
28+
29+
- name: Checkout Code
30+
uses: actions/checkout@v3
31+
32+
- name: Set up JDK ${{ matrix.Java }}
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: ${{ matrix.java }}
36+
distribution: "zulu"
37+
cache: "maven"
38+
39+
- name: Cache Maven packages
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.m2
43+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44+
restore-keys: ${{ runner.os }}-m2
45+
46+
- name: Build Common-Api
47+
run: |
48+
PROJECT_NAME=
49+
cd $PROJECT_HOME/$PROJECT_NAME
50+
mvn clean package -DskipTests=true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://github.com/marketplace/actions/conventional-commit-lint
2+
3+
name: Conventional Commit Lint
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
commit-lint:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
# conventional style
12+
- uses: ahmadnassri/action-commit-lint@v2.0.4

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Maven Central Repo Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [released]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Checkout Code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Maven Central Repo
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
server-id: sonatype-nexus-staging
21+
server-username: ${{ secrets.PUBLISH_OSSRH_USER }}
22+
server-password: ${{ secrets.PUBLISH_OSSRH_PASSWORD }}
23+
gpg-passphrase: ${{ secrets.PUBLISH_GPG_PASSWORD }}
24+
25+
- name: Publish to Maven Central Repo
26+
uses: samuelmeuli/action-maven-publish@v1
27+
with:
28+
gpg_private_key: ${{ secrets.PUBLISH_GPG_SECRET }}
29+
gpg_passphrase: ${{ secrets.PUBLISH_GPG_PASSWORD }}
30+
nexus_username: ${{ secrets.PUBLISH_OSSRH_USER }}
31+
nexus_password: ${{ secrets.PUBLISH_OSSRH_PASSWORD }}

.github/workflows/sonar.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Sonar CI
2+
on:
3+
workflow_dispatch:
4+
push:
5+
# paths:
6+
# - "common*/**"
7+
# - ".github/workflows/build-common-api.yml"
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
11+
concurrency:
12+
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-and-analyze:
17+
name: Sonar Analysis on JDK 11
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v3
27+
with:
28+
java-version: 11
29+
distribution: "zulu"
30+
cache: "maven"
31+
32+
- name: Cache SonarCloud packages
33+
uses: actions/cache@v3
34+
with:
35+
path: ~/.sonar/cache
36+
key: ${{ runner.os }}-sonar
37+
restore-keys: ${{ runner.os }}-sonar
38+
39+
- name: Cache Maven packages
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.m2
43+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44+
restore-keys: ${{ runner.os }}-m2
45+
46+
- name: Run SonarQube Analysis
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
49+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
50+
run: mvn -B verify -DskipTests=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Alice52_common-api

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
/**/log/
7+
logs/
8+
9+
# maven
10+
target/
11+
12+
# gralde
13+
.gradle/
14+
build/
15+
16+
# ide
17+
.idea/
18+
out/
19+
20+
# Package Files #
21+
*.jar
22+
*.war
23+
*.nar
24+
*.ear
25+
*.zip
26+
*.tar.gz
27+
*.rar
28+
*.iml
29+
*.iws
30+
*.ipr
31+
*.kotlin_module
32+
hs_err_pid*
33+
34+
# frontend
35+
**/node_modules/
36+
37+
!gradle-wrapper.jar
38+
*.txt
39+
*.hprof
40+
*.threads
41+
*.index

.husky/init.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd ..
4+
# 安装 husky
5+
npm install -g husky
6+
7+
# 安装 husky git hooks
8+
npx husky install
9+
10+
# commitlint 安装配置
11+
npm install -g @commitlint/cli @commitlint/config-conventional
12+
13+
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > ../commitlint.config.js
14+
15+
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Alice52
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## common-api
2+
3+
1. this is spring common api
4+
5+
## wip
6+
7+
1. com.github.rholder.retry.Retryer
8+
9+
## issues
10+
11+
1. common-mq
12+
13+
- return 与 conform 的顺序问题
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>common-actuator</artifactId>
7+
<groupId>io.github.alice52</groupId>
8+
<version>0.0.2</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<artifactId>common-actuator-client</artifactId>
12+
13+
<dependencies>
14+
<dependency>
15+
<groupId>de.codecentric</groupId>
16+
<artifactId>spring-boot-admin-starter-client</artifactId>
17+
</dependency>
18+
</dependencies>
19+
</project>

0 commit comments

Comments
 (0)