Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release dev ops #243

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.DEVELOPMENT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


2 changes: 1 addition & 1 deletion jmock-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion jmock-imposters-testdata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>

<artifactId>jmock-imposters-testdata</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jmock-imposters-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>
<artifactId>jmock-imposters-tests</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion jmock-imposters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>
<artifactId>jmock-imposters</artifactId>
<description>Class mocks are more numerous than interface mocks, so drop the legacy name</description>
Expand Down
2 changes: 1 addition & 1 deletion jmock-junit3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>

<artifactId>jmock-junit3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jmock-junit4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion jmock-junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion jmock-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion jmock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>jMock 2 Parent</name>

Expand Down
2 changes: 1 addition & 1 deletion testjar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.13.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading