Compare commits
8 Commits
acba4c11d9
...
v0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 5612d6a24a | |||
| 381d149cd2 | |||
| db530c1fed | |||
| 3b572491d0 | |||
| 1fe9cf7b77 | |||
| 452d525d83 | |||
| 0d21b154ca | |||
| 8153df0b90 |
@ -11,7 +11,13 @@ jobs:
|
||||
build-deploy:
|
||||
runs-on: act_runner_java
|
||||
if: ${{ github.event.pull_request.merged == true }}
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-21-openjdk
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone ${{ github.server_url }}/${{ github.repository }}.git .
|
||||
git checkout ${{ github.sha }}
|
||||
- name: Set up environment
|
||||
run: |
|
||||
echo "PR #${{ github.event.number }} merged into master"
|
||||
@ -23,7 +29,7 @@ jobs:
|
||||
- name: Build project
|
||||
run: |
|
||||
mvn -B -DskipTests clean package source:jar javadoc:jar
|
||||
- name: Deploy
|
||||
- name: Deploy to Nexus
|
||||
if: success()
|
||||
run: |
|
||||
if [ -z "${{ secrets.NEXUS_USERNAME }}" ] || [ -z "${{ secrets.NEXUS_PASSWORD }}" ]; then
|
||||
@ -59,25 +65,11 @@ jobs:
|
||||
-Djavadoc="$javadoc_jar" \
|
||||
-DpomFile="./pom.xml" \
|
||||
-Durl="https://nexus.imyeyu.com/repository/maven-releases/" \
|
||||
-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
|
||||
-DrepositoryId="timi-nexus" \
|
||||
-Dhttps.protocols=TLSv1.2 \
|
||||
-Djdk.tls.client.protocols=TLSv1.2
|
||||
- name: Create release
|
||||
if: ${{ success() && startsWith(github.event.pull_request.title, 'v') }}
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
||||
GITEA_SERVER_URL: ${{ github.server_url }}
|
||||
@ -109,11 +101,7 @@ jobs:
|
||||
echo "Create release failed: $response"
|
||||
exit 1
|
||||
fi
|
||||
if ! ls dist/*.jar >/dev/null 2>&1; then
|
||||
echo "Missing jar artifact in dist"
|
||||
exit 1
|
||||
fi
|
||||
for asset_path in dist/*.jar; do
|
||||
for asset_path in target/*.jar; do
|
||||
asset_name=$(basename "$asset_path")
|
||||
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
|
||||
Reference in New Issue
Block a user