This commit is contained in:
@ -23,7 +23,7 @@ jobs:
|
|||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
mvn -B -DskipTests clean package source:jar javadoc:jar
|
mvn -B -DskipTests clean package source:jar javadoc:jar
|
||||||
- name: Deploy
|
- name: Deploy to Nexus
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ secrets.NEXUS_USERNAME }}" ] || [ -z "${{ secrets.NEXUS_PASSWORD }}" ]; then
|
if [ -z "${{ secrets.NEXUS_USERNAME }}" ] || [ -z "${{ secrets.NEXUS_PASSWORD }}" ]; then
|
||||||
@ -60,24 +60,8 @@ jobs:
|
|||||||
-DpomFile="./pom.xml" \
|
-DpomFile="./pom.xml" \
|
||||||
-Durl="https://nexus.imyeyu.com/repository/maven-releases/" \
|
-Durl="https://nexus.imyeyu.com/repository/maven-releases/" \
|
||||||
-DrepositoryId="timi-nexus"
|
-DrepositoryId="timi-nexus"
|
||||||
- name: Upload jar artifact
|
|
||||||
if: success()
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: build-jar
|
|
||||||
path: target/*.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
create-release:
|
|
||||||
runs-on: act_runner_base
|
|
||||||
needs: build-deploy
|
|
||||||
if: ${{ success() && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.title, 'v') }}
|
|
||||||
steps:
|
|
||||||
- name: Download jar artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: build-jar
|
|
||||||
path: dist
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
|
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
||||||
GITEA_SERVER_URL: ${{ github.server_url }}
|
GITEA_SERVER_URL: ${{ github.server_url }}
|
||||||
@ -109,11 +93,7 @@ jobs:
|
|||||||
echo "Create release failed: $response"
|
echo "Create release failed: $response"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! ls dist/*.jar >/dev/null 2>&1; then
|
for asset_path in target/*.jar; do
|
||||||
echo "Missing jar artifact in dist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
for asset_path in dist/*.jar; do
|
|
||||||
asset_name=$(basename "$asset_path")
|
asset_name=$(basename "$asset_path")
|
||||||
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
|
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
|||||||
Reference in New Issue
Block a user