mirror of
https://gitee.com/yadong.zhang/JustAuth.git
synced 2025-12-06 16:58:24 +08:00
ci: 快照版本切换,使用 python 脚本替换 maven 插件
This commit is contained in:
parent
9ced525309
commit
ea70c5fc81
18
.github/workflows/deploy-snapshot.yml
vendored
18
.github/workflows/deploy-snapshot.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Deploy snapshot for dev branch
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -47,11 +47,17 @@ jobs:
|
|||||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-maven-
|
${{ runner.os }}-maven-
|
||||||
- name: get current project version to set env.VERSION
|
- name: setting snapshot version
|
||||||
run: echo "VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`" >> $GITHUB_ENV
|
run: |
|
||||||
- name: set snapshot version
|
import xml.etree.ElementTree as ET
|
||||||
if: ${{ !endsWith( env.VERSION , '-SNAPSHOT') }}
|
tree = ET.parse("pom.xml")
|
||||||
run: mvn versions:set -DnewVersion=${{ env.VERSION }}-SNAPSHOT
|
version = tree.find("{http://maven.apache.org/POM/4.0.0}version")
|
||||||
|
print(version.text + "-SNAPSHOT")
|
||||||
|
if version.text.endswith("-SNAPSHOT") == False:
|
||||||
|
tree.find("{http://maven.apache.org/POM/4.0.0}version").text = version.text + "-SNAPSHOT"
|
||||||
|
ET.register_namespace("", "http://maven.apache.org/POM/4.0.0")
|
||||||
|
tree.write("pom.xml", "utf-8", True)
|
||||||
|
shell: python
|
||||||
- name: deploy snapshot to ossrh repository
|
- name: deploy snapshot to ossrh repository
|
||||||
run: mvn -B deploy -P snapshot -DskipTests
|
run: mvn -B deploy -P snapshot -DskipTests
|
||||||
env:
|
env:
|
||||||
|
|||||||
1
.github/workflows/test-pr.yml
vendored
1
.github/workflows/test-pr.yml
vendored
@ -2,7 +2,6 @@ name: test pull_request
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ dev ]
|
|
||||||
paths:
|
paths:
|
||||||
- src/**
|
- src/**
|
||||||
- pom.xml
|
- pom.xml
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user