From 99cad2b19b154adeea2bceded30857e353e168ee Mon Sep 17 00:00:00 2001
From: opensnail <598092184@qq.com>
Date: Wed, 5 Jun 2024 21:36:31 +0800
Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.0.0):=20=E4=BD=BF=E7=94=A8github=20?=
=?UTF-8?q?ci=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/docker-image.yml | 45 +++++++++++++++++++++++++++++
.github/workflows/maven-publish.yml | 42 +++++++++++++++++++++++++++
pom.xml | 9 +++++-
3 files changed, 95 insertions(+), 1 deletion(-)
create mode 100644 .github/workflows/docker-image.yml
create mode 100644 .github/workflows/maven-publish.yml
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
new file mode 100644
index 00000000..9dc0e3a5
--- /dev/null
+++ b/.github/workflows/docker-image.yml
@@ -0,0 +1,45 @@
+name: DockerHub - Build & Push
+
+on:
+ push:
+ tags:
+ - v*
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: maven
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+
+ - name: Get Maven project version
+ id: version
+ run: |
+ echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Build and push Docker image
+ env:
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
+ DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
+ run: |
+ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
+ cd snail-job-server/snail-job-server-starter/ \
+ && docker buildx build --platform linux/amd64,linux/arm64 \
+ -t opensnail/snail-job:latest \
+ -t opensnail/snail-job:${{ steps.version.outputs.version }} \
+ --push .
\ No newline at end of file
diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml
new file mode 100644
index 00000000..005cd0c2
--- /dev/null
+++ b/.github/workflows/maven-publish.yml
@@ -0,0 +1,42 @@
+name: Maven - Build & Publish
+
+on:
+ push:
+ tags:
+ - v*
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: maven
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ - name: Set up Apache Maven Central
+ uses: actions/setup-java@v4
+ with: # running setup-java again overwrites the settings.xml
+ distribution: 'temurin'
+ java-version: '17'
+ server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
+ server-username: MAVEN_USERNAME # env variable for username in deploy
+ server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
+ gpg-private-key: ${{ secrets.GPG_SECRET }} # Value of the GPG private key to import
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
+
+ - name: Publish to Apache Maven Central
+ run: mvn deploy -P release -f pom.xml
+ env:
+ MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index d49f0d40..0da15f02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
17
17
17
- 1.0.0-beta3
+ 1.0.0-beta3.1
1.0.0
4.1.94.Final
5.8.25
@@ -272,6 +272,13 @@
sign
+
+
+
+ --pinentry-mode
+ loopback
+
+