Skip to content

Commit

Permalink
🔖 Releasing / Version tags. 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed May 13, 2022
1 parent 967a020 commit 8de326c
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 23 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: idempotent-spring-boot-starter

on:
push:
branches: [ master,dev ]
pull_request:
branches: [ master,dev ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: mvn clean install
run: mvn clean install -Dmaven.test.skip=true

- name: mvn spring-javaformat:validate
run: mvn spring-javaformat:validate
45 changes: 45 additions & 0 deletions .github/workflows/oss-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: publish maven package
on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
oss-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven

# - name: Build with Maven
# run: mvn -B package --file pom.xml

# - name: Publish to GitHub Packages Apache Maven
# run: mvn deploy
# env:
# GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password

- name: Setup Maven Central
uses: actions/setup-java@v3
with: # overwrite settings.xml
java-version: '11'
distribution: 'adopt'
server-id: sonatype
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn clean deploy -Dmaven.test.skip=true -P 'release'
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>multilevel-cache-spring-boot-starter</artifactId>
<version>0.0.6</version>
<version>0.0.7</version>
</dependency>
```

Expand Down
13 changes: 6 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<version>2.6.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>multilevel-cache-spring-boot-starter</artifactId>
<version>0.0.6</version>
<version>0.0.7</version>
<name>multilevel-cache-spring-boot-starter</name>
<description>support L1 caffeine and L2 redis cache</description>
<url>https://pig4cloud.com</url>
Expand All @@ -30,15 +30,15 @@
</developers>
<scm>
<tag>master</tag>
<connection>https://github.com/pig-mesh/multilevel-cache-spring-boot-starter</connection>
<developerConnection>https://pig4cloud.com</developerConnection>
<url>https://github.com/pig-mesh</url>
<connection>https://gitee.wang/lengleng/pig</connection>
<developerConnection>https://pigx.top</developerConnection>
<url>https://gitee.wang/lengleng/pig.git</url>
</scm>

<properties>
<java.version>1.8</java.version>
<mica.version>2.2.2</mica.version>
<spring.checkstyle.plugin>0.0.31</spring.checkstyle.plugin>
<spring.checkstyle.plugin>0.0.29</spring.checkstyle.plugin>
</properties>

<dependencies>
Expand Down Expand Up @@ -70,7 +70,6 @@
<optional>true</optional>
</dependency>

<!-- 包含有 spring-boot-configuration-processor -->
<dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-auto</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
@SuppressWarnings("JavadocReference")
public enum CaffeineStrength {
/** 弱引用 */ WEAK,
/** 软引用 */ SOFT

/** 弱引用 */
WEAK,
/** 软引用 */
SOFT

}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public ValueWrapper putIfAbsent(Object key, Object value) {
return toValueWrapper(prevValue);
}

private void doPut(Object key,Object value){
private void doPut(Object key, Object value) {
Duration expire = getExpire();
value = toStoreValue(value);
if (!expire.isNegative()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ public com.github.benmanes.caffeine.cache.Cache<Object, Object> caffeineCache()
}
if (cacheConfigProperties.getCaffeine().getKeyStrength() != null) {
switch (cacheConfigProperties.getCaffeine().getKeyStrength()) {
case WEAK:
cacheBuilder.weakKeys();
break;
case SOFT:
throw new UnsupportedOperationException("caffeine 不支持 key 软引用");
default:
case WEAK:
cacheBuilder.weakKeys();
break;
case SOFT:
throw new UnsupportedOperationException("caffeine 不支持 key 软引用");
default:
}
}
if (cacheConfigProperties.getCaffeine().getValueStrength() != null) {
switch (cacheConfigProperties.getCaffeine().getValueStrength()) {
case WEAK:
cacheBuilder.weakValues();
break;
case SOFT:
cacheBuilder.softValues();
default:
case WEAK:
cacheBuilder.weakValues();
break;
case SOFT:
cacheBuilder.softValues();
default:
}
}
return cacheBuilder.build();
Expand Down

0 comments on commit 8de326c

Please sign in to comment.