diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..92816e7f3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Maven deploy release +on: + pull_request: + types: + - opened + branches: + - 'master' # only trigger from master +jobs: + run_if: + if: startsWith(github.head_ref, 'releases/') # targeting releases + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + + - name: Split branch into release version + env: + BRANCH: ${{ github.ref_name }} + id: split + run: echo "::set-output name=fragment::${BRANCH##*/}" + + - name: Maven set release version + run: | + mvn versions:set -DoldVersion=\* -DnewVersion=${{ steps.split.outputs.fragment }} -DgroupId=org.jmock -DgenerateBackupPoms=false + git commit --no-edit + git tag -a -m "Release version ${{ steps.split.outputs.fragment }}" ${{ steps.split.outputs.fragment }} + git push origin HEAD --tags + diff --git a/.github/workflows/deploy.yml b/.github/workflows/snapshot.yml similarity index 78% rename from .github/workflows/deploy.yml rename to .github/workflows/snapshot.yml index 3af4c2954..49653c4be 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/snapshot.yml @@ -1,11 +1,7 @@ -name: Maven deploy to Maven Central +name: Maven deploy snapshot on: push: - # Pattern matched against refs/tags - tags: - - '*' # Push events to every tag not containing / - release: - types: [created] + branches: [ master ] jobs: publish: runs-on: ubuntu-latest diff --git a/README.DEVELOPMENT b/README.DEVELOPMENT index 12bd72b0c..f00b7f61b 100644 --- a/README.DEVELOPMENT +++ b/README.DEVELOPMENT @@ -39,7 +39,7 @@ result of the wrong type. Release ======= -mvn versions:set -DoldVersion=* -DnewVersion=2.10.0 -DgroupId=org.jmock -DgenerateBackupPoms=false +mvn versions:set -DoldVersion=\* -DnewVersion=2.10.0 -DgroupId=org.jmock -DgenerateBackupPoms=false eval $(gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info) export GPG_AGENT_INFO @@ -48,5 +48,6 @@ export SONATYPE_USERNAME=UUU export SONATYPE_PASSWORD=PPPP mvn clean deploy -P release --settings settings.xml -Dgpg.keyname=XXXXXXXX -mvn versions:set -DoldVersion=* -DnewVersion=2.11.0-SNAPSHOT -DgroupId=org.jmock -DgenerateBackupPoms=false +mvn versions:set -DoldVersion=\* -DnextSnapshot=true -DgroupId=org.jmock -DgenerateBackupPoms=false + diff --git a/jmock-example/pom.xml b/jmock-example/pom.xml index 6e431ef32..2196162f7 100644 --- a/jmock-example/pom.xml +++ b/jmock-example/pom.xml @@ -12,7 +12,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT ../pom.xml diff --git a/jmock-imposters-testdata/pom.xml b/jmock-imposters-testdata/pom.xml index 46ee99cbf..fef697ae2 100644 --- a/jmock-imposters-testdata/pom.xml +++ b/jmock-imposters-testdata/pom.xml @@ -6,7 +6,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT jmock-imposters-testdata diff --git a/jmock-imposters-tests/pom.xml b/jmock-imposters-tests/pom.xml index 9113310db..eaa557444 100644 --- a/jmock-imposters-tests/pom.xml +++ b/jmock-imposters-tests/pom.xml @@ -6,7 +6,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT jmock-imposters-tests diff --git a/jmock-imposters/pom.xml b/jmock-imposters/pom.xml index 153724448..e495a39b5 100644 --- a/jmock-imposters/pom.xml +++ b/jmock-imposters/pom.xml @@ -6,7 +6,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT jmock-imposters Class mocks are more numerous than interface mocks, so drop the legacy name diff --git a/jmock-junit3/pom.xml b/jmock-junit3/pom.xml index b30abe9bd..2b42cc5f1 100644 --- a/jmock-junit3/pom.xml +++ b/jmock-junit3/pom.xml @@ -7,7 +7,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT jmock-junit3 diff --git a/jmock-junit4/pom.xml b/jmock-junit4/pom.xml index aac41b1a4..0af8ea998 100644 --- a/jmock-junit4/pom.xml +++ b/jmock-junit4/pom.xml @@ -10,7 +10,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT diff --git a/jmock-junit5/pom.xml b/jmock-junit5/pom.xml index c248cc51c..b54ea2cc7 100644 --- a/jmock-junit5/pom.xml +++ b/jmock-junit5/pom.xml @@ -9,7 +9,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT diff --git a/jmock-legacy/pom.xml b/jmock-legacy/pom.xml index 30efb47b6..6f123004b 100644 --- a/jmock-legacy/pom.xml +++ b/jmock-legacy/pom.xml @@ -10,7 +10,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT diff --git a/jmock/pom.xml b/jmock/pom.xml index 80bf8261c..108080b9e 100644 --- a/jmock/pom.xml +++ b/jmock/pom.xml @@ -10,7 +10,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 858df28aa..bc3bb08da 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT pom jMock 2 Parent diff --git a/testjar/pom.xml b/testjar/pom.xml index 97557cd47..589957549 100644 --- a/testjar/pom.xml +++ b/testjar/pom.xml @@ -11,7 +11,7 @@ org.jmock jmock-parent - 2.13.0-SNAPSHOT + 2.13.1-SNAPSHOT ../pom.xml