diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..dab69fe --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/src/main/java/cn/ofpp/Application.java b/src/main/java/cn/ofpp/Application.java index bc20824..59666cf 100644 --- a/src/main/java/cn/ofpp/Application.java +++ b/src/main/java/cn/ofpp/Application.java @@ -29,13 +29,10 @@ public static void main(String[] args) { // new 一个 女友 GirlFriend girlFriend = new GirlFriend("某女友", - "江苏省", "南京市", "1999-08-08", "2011-04-16", "oQFk-5qtXv2uGNCu9oiCiV85KWD8"); + "江苏省", "南京市", "1999-08-08", "2011-04-16", "oQMt-6VqZ7NmcbM8083_2zD38zJA "); Wx.sendTemplateMessage(MessageFactory.resolveMessage(girlFriend)); - // new 一个 男友 也可单独针对一个friend设置模板ID 以达到不同人不同消息 - BoyFriend boyFriend = new BoyFriend("某男友", - "江苏省", "南京市", "1999-08-08", "2011-04-16", "oQFk-5qtXv2uGNCu9oiCiV85KWD8", "5t7-Ksy8_rw-QmUkxf8J7Pe-QLQ2rBc7RWJi_pSmeh4"); - Wx.sendTemplateMessage(MessageFactory.resolveMessage(boyFriend)); + } } diff --git a/src/main/java/cn/ofpp/Bootstrap.java b/src/main/java/cn/ofpp/Bootstrap.java index 561e88c..ad5bb7a 100644 --- a/src/main/java/cn/ofpp/Bootstrap.java +++ b/src/main/java/cn/ofpp/Bootstrap.java @@ -14,17 +14,17 @@ public class Bootstrap { /** * 公众号AppID */ - public static final String APP_ID = ""; + public static final String APP_ID = "wxd00606311d4294bb"; /** * 公众号秘钥 */ - public static final String SECRET = ""; + public static final String SECRET = "a39844ff60166cfd73729e95e502eff7"; /** * 全局模板ID 也可针对单个Friend指定模板 */ - public static final String TEMPLATE_ID = ""; + public static final String TEMPLATE_ID = "Oh9MGZK8fvxNcPWMRgJnlA5V_lxKoGDKSt7rppW_v34 "; /** * 初始化