Skip to content

Commit 2da3c80

Browse files
committed
fixed workflow
1 parent 8bb5fcf commit 2da3c80

File tree

3 files changed

+55
-53
lines changed

3 files changed

+55
-53
lines changed

.github/workflows/mvn-publish.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
17-
- uses: actions/setup-java@v1
17+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
1818
with:
19-
java-version: 1.8
20-
- uses: actions/cache@v2
21-
with:
22-
key: ${{ hashFiles('pom.xml') }}
23-
path: ~/.m2/repository
24-
- name: Prepare version
25-
id: maven-version
19+
java-version: 11
20+
distribution: temurin
21+
check-latest: true
22+
cache: maven
23+
server-id: central
24+
server-username: OSSRH_USERNAME
25+
server-password: OSSRH_PASSWORD
26+
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
27+
- name: Publish artifacts
28+
env:
29+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
30+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
31+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
2632
run: |
2733
mvn_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
2834
git_ref=${GITHUB_REF##*/}
2935
pr_number=${{ github.event.number }}
3036
if [[ $git_ref =~ v[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
3137
if [[ v$mvn_version != $git_ref ]] ; then
32-
echo Maven version $mvn_version does not match tag $git_ref
38+
echo ::error title=Version mismatch::Maven version $mvn_version does not match tag $git_ref
3339
exit 1
3440
fi
3541
elif [[ $pr_number != "" && $mvn_version =~ -SNAPSHOT$ ]] ; then
3642
pattern="s/(.+)-SNAPSHOT/\1-"$pr_number"-SNAPSHOT/g"
3743
mvn_version=$(echo $mvn_version | sed -E $pattern)
3844
mvn versions:set -DnewVersion=$mvn_version -DgenerateBackupPoms=false -q -DforceStdout
45+
echo Setting version to $mvn_version
3946
elif [[ ! $mvn_version =~ -SNAPSHOT$ ]] ; then
40-
echo Refusing to publish non-snapshot version $mvn_version
41-
echo '::set-output name=skip-publish::true'
47+
echo ::error title=Non-SNAPSHOT version::Refusing to publish non-snapshot version $mvn_version
48+
exit 1
4249
fi
43-
- uses: samuelmeuli/action-maven-publish@v1.4.0
44-
if:
45-
${{ steps.maven-version.outputs.skip-publish != 'true' }}
46-
with:
47-
gpg_private_key: ${{ secrets.OSSRH_GPG_KEY_ASCII }}
48-
gpg_passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
49-
nexus_username: ${{ secrets.OSSRH_USERNAME }}
50-
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
50+
mvn -B deploy

.github/workflows/tests.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,14 @@ on:
1010

1111
jobs:
1212
run_tests:
13-
1413
runs-on: ubuntu-latest
15-
1614
steps:
17-
- name: Checkout the repository
18-
uses: actions/checkout@v2
15+
- uses: actions/checkout@v5
16+
- uses: actions/setup-java@v5
1917
with:
20-
fetch-depth: 1
21-
22-
- name: Set up JDK 8
23-
uses: actions/setup-java@v1
24-
with:
25-
java-version: 8
26-
27-
- name: Cache Maven packages
28-
uses: actions/cache@v2
29-
with:
30-
path: ~/.m2
31-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32-
restore-keys: ${{ runner.os }}-m2
33-
34-
- name: Run tests
35-
run: mvn -B test -Dmaven.test.failure.ignore=true
36-
18+
java-version: 11
19+
distribution: temurin
20+
cache: maven
21+
- run: mvn -B test -Dmaven.test.failure.ignore=true
3722
- name: Publish test report
3823
uses: scacap/action-surefire-report@v1
39-
with:
40-
github_token: ${{ secrets.GITHUB_TOKEN }}

pom.xml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,35 +144,54 @@
144144
</configuration>
145145
</plugin>
146146
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-dependency-plugin</artifactId>
149-
<version>3.3.0</version>
147+
<groupId>org.apache.maven.plugins</groupId>
148+
<artifactId>maven-dependency-plugin</artifactId>
149+
<version>3.3.0</version>
150150
</plugin>
151151
</plugins>
152152
</build>
153153

154+
<repositories>
155+
<repository>
156+
<id>central-portal-snapshots</id>
157+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
158+
<releases>
159+
<enabled>false</enabled>
160+
</releases>
161+
<snapshots>
162+
<enabled>true</enabled>
163+
</snapshots>
164+
</repository>
165+
</repositories>
166+
154167
<distributionManagement>
155168
<snapshotRepository>
156-
<id>ossrh</id>
157-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
169+
<id>central</id>
170+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
158171
</snapshotRepository>
159-
<repository>
160-
<id>ossrh</id>
161-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
162-
</repository>
163172
</distributionManagement>
164173

174+
<dependencyManagement>
175+
<dependencies>
176+
<dependency>
177+
<groupId>org.bouncycastle</groupId>
178+
<artifactId>bcprov-jdk18on</artifactId>
179+
<version>1.82</version>
180+
</dependency>
181+
</dependencies>
182+
</dependencyManagement>
183+
165184
<dependencies>
166185
<!-- waves -->
167186
<dependency>
168187
<groupId>com.wavesplatform</groupId>
169188
<artifactId>waves-crypto</artifactId>
170-
<version>2.0.6-SNAPSHOT</version>
189+
<version>2.0.6-11-SNAPSHOT</version>
171190
</dependency>
172191
<dependency>
173192
<groupId>com.wavesplatform</groupId>
174193
<artifactId>protobuf-schemas</artifactId>
175-
<version>1.5.3-4-SNAPSHOT</version>
194+
<version>1.6.0-90-SNAPSHOT</version>
176195
</dependency>
177196

178197
<!-- json -->

0 commit comments

Comments
 (0)