Skip to content

Commit 38a5e7b

Browse files
committed
Try to fix releases again.
Use maven server to specify git username/password Remove references to maven-deploy-plugin, since nexus-staging-maven-plugin overrides it
1 parent d4e62b2 commit 38a5e7b

File tree

4 files changed

+11
-43
lines changed

4 files changed

+11
-43
lines changed

.github/maven/settings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
22
<servers>
3+
<server>
4+
<id>github</id>
5+
<username>${env.GITHUB_ACTOR}</username>
6+
<password>${env.GITHUB_TOKEN}</password>
7+
</server>
38
<server>
49
<id>ossrh</id>
510
<username>${env.OSSRH_USERNAME}</username>

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
if: github.event_name == 'push' && github.repository == 'logstash/logstash-logback-encoder' && github.ref == 'refs/heads/main' && startsWith(github.event.commits[0].message, '[release]')
5454
steps:
5555
- name: Checkout Code
56-
uses: actions/checkout@v1.1.0
56+
uses: actions/checkout@v2
5757
with:
5858
ref: main
5959

@@ -86,5 +86,7 @@ jobs:
8686
- name: Release
8787
run: ./mvnw --batch-mode --no-transfer-progress --show-version --settings .github/maven/settings.xml --activate-profiles ossrh release:prepare release:perform
8888
env:
89+
GITHUB_ACTOR: ${{ GITHUB_ACTOR }}
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8991
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
9092
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

.github/workflows/steps/setup-git.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,3 @@ git config --local tag.forceSignAnnotated true
1919
echo Setting git user to "${GPG_USER_NAME}" with email "${GPG_USER_EMAIL}"
2020
git config --local user.name "${GPG_USER_NAME}"
2121
git config --local user.email "${GPG_USER_EMAIL}"
22-
23-
echo Propagating git authentication from local config to global config
24-
git config --global http.https://github.com/.extraheader "$(git config --get http.https://github.com/.extraheader)"
25-

pom.xml

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
4545
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
4646
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
47-
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
4847
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
4948
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
5049
<maven-install-plugin.version>3.0.0-M1</maven-install-plugin.version>
@@ -62,6 +61,9 @@
6261
<!-- maven-javadoc-plugin configuration -->
6362
<maven.javadoc.failOnError>true</maven.javadoc.failOnError>
6463
<maven.javadoc.failOnWarnings>true</maven.javadoc.failOnWarnings>
64+
65+
<!-- the server id the maven-release-plugin uses to obtain credentials to use when pushing tags/commits -->
66+
<project.scm.id>github</project.scm.id>
6567
</properties>
6668

6769
<licenses>
@@ -433,12 +435,6 @@
433435
</configuration>
434436
</plugin>
435437

436-
<plugin>
437-
<groupId>org.apache.maven.plugins</groupId>
438-
<artifactId>maven-deploy-plugin</artifactId>
439-
<version>${maven-deploy-plugin.version}</version>
440-
</plugin>
441-
442438
<plugin>
443439
<groupId>org.apache.maven.plugins</groupId>
444440
<artifactId>maven-install-plugin</artifactId>
@@ -541,10 +537,6 @@
541537
<groupId>org.apache.maven.plugins</groupId>
542538
<artifactId>maven-release-plugin</artifactId>
543539
<version>${maven-release-plugin.version}</version>
544-
<configuration>
545-
<!-- Use our own profile instead of the default "release-profile" -->
546-
<releaseProfiles>release</releaseProfiles>
547-
</configuration>
548540
</plugin>
549541

550542
<plugin>
@@ -601,33 +593,6 @@
601593
</properties>
602594
</profile>
603595

604-
<!-- Profile activated during release:prepare and release:perform instead
605-
of the legacy release-profile that is otherwise activated during a release
606-
build by the maven-release-plugin.
607-
608-
Reasons are:
609-
- the "sources" artifact is produced by the shade plugin. The one produced by
610-
the legacy profile must be discarded.
611-
- javadoc is already produced by normal builds.
612-
613-
Note: maven-deploy-plugin:3.0.0 does not support the "updateReleaseInfo" configuration
614-
parameter anymore. This profile can be removed after upgrading.
615-
-->
616-
<profile>
617-
<id>release</id>
618-
<build>
619-
<plugins>
620-
<plugin>
621-
<groupId>org.apache.maven.plugins</groupId>
622-
<artifactId>maven-deploy-plugin</artifactId>
623-
<configuration>
624-
<updateReleaseInfo>true</updateReleaseInfo>
625-
</configuration>
626-
</plugin>
627-
</plugins>
628-
</build>
629-
</profile>
630-
631596
<profile>
632597
<id>github</id>
633598
<activation>

0 commit comments

Comments
 (0)