Skip to content

Commit 10af1dc

Browse files
authored
Merge pull request codecentric#1594 from codecentric/feat1579/github-actions-release
Release with GitHub Actions
2 parents 48fa58f + 1acd775 commit 10af1dc

File tree

10 files changed

+158
-172
lines changed

10 files changed

+158
-172
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up JDK 1.8
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 1.8
16+
17+
- name: Build with Maven
18+
run: mvn -B install --no-transfer-progress --file pom.xml
19+
20+
publish-snapshot:
21+
needs: build
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up settings.xml for GitHub Packages
28+
uses: actions/setup-java@v1
29+
with:
30+
java-version: 1.8
31+
32+
- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
33+
run: mvn -B --no-transfer-progress deploy -DskipTests
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract Maven project version for Asciidoc GitHub Pages directory naming
38+
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
39+
id: project
40+
41+
- name: Show extracted Maven project version
42+
run: echo ${{ steps.project.outputs.version }}
43+
44+
- name: Deploy Asciidoc docs output to GitHub Pages
45+
uses: JamesIves/github-pages-deploy-action@3.7.1
46+
with:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
BRANCH: gh-pages # The branch the action should deploy to.
49+
FOLDER: spring-boot-admin-docs/target/generated-docs # The folder the action should deploy.
50+
TARGET_FOLDER: ${{ steps.project.outputs.version }}
51+
CLEAN: true # Automatically remove deleted files from the deploy branch

.github/workflows/maven.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: release-to-maven-central
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseversion:
7+
description: 'Release version'
8+
required: true
9+
default: '2.4.0'
10+
11+
jobs:
12+
publish-central-and-pages:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
16+
17+
- uses: actions/checkout@v2
18+
19+
- name: Set up settings.xml for Maven Central Repository
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 8
23+
server-id: oss.sonatype.org
24+
server-username: MAVEN_USERNAME
25+
server-password: MAVEN_PASSWORD
26+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
27+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
28+
29+
- name: Set projects Maven version to GitHub Action GUI set version
30+
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress
31+
32+
- name: Publish package
33+
run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
37+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
38+
39+
- name: Deploy Asciidoc docs output to GitHub Pages
40+
uses: JamesIves/github-pages-deploy-action@3.7.1
41+
with:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
BRANCH: gh-pages # The branch the action should deploy to.
44+
FOLDER: spring-boot-admin-docs/target/generated-docs # The folder the action should deploy.
45+
TARGET_FOLDER: ${{ github.event.inputs.releaseversion }}
46+
CLEAN: true # Automatically remove deleted files from the deploy branch
47+
48+
49+
publish-github-release:
50+
needs: publish-central-and-pages
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: actions/checkout@v2
55+
56+
- name: Generate changelog
57+
id: changelog
58+
uses: metcalfc/changelog-generator@v0.4.4
59+
with:
60+
myToken: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Create GitHub Release
63+
id: create_release
64+
uses: actions/create-release@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
tag_name: ${{ github.event.inputs.releaseversion }}
69+
release_name: ${{ github.event.inputs.releaseversion }}
70+
body: |
71+
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/
72+
73+
Current docs at https://codecentric.github.io/spring-boot-admin/${{ github.event.inputs.releaseversion }}/
74+
75+
### Things that changed in this release
76+
${{ steps.changelog.outputs.changelog }}
77+
draft: false
78+
prerelease: false

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
codecentric's Spring Boot Admin
22
===============================
33
[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
4-
[![Build Status](https://github.com/codecentric/spring-boot-admin/workflows/github/badge.svg)](https://github.com/codecentric/spring-boot-admin/actions)
4+
[![Build Status](https://github.com/codecentric/spring-boot-admin/workflows/build/badge.svg)](https://github.com/codecentric/spring-boot-admin/actions)
55
[![Build Status](https://travis-ci.org/codecentric/spring-boot-admin.svg?branch=master)](https://travis-ci.org/codecentric/spring-boot-admin)
66
[![Coverage Status](https://coveralls.io/repos/github/codecentric/spring-boot-admin/badge.svg?branch=master)](https://coveralls.io/github/codecentric/spring-boot-admin?branch=master)
77
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.codecentric/spring-boot-admin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.codecentric/spring-boot-admin/)

deploy-settings.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

pom.xml

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -408,42 +408,7 @@
408408
</modules>
409409
</profile>
410410
<profile>
411-
<id>sign-artifacts</id>
412-
<activation>
413-
<property>
414-
<name>env.GPG_PASSPHRASE</name>
415-
</property>
416-
</activation>
417-
<build>
418-
<plugins>
419-
<plugin>
420-
<groupId>org.apache.maven.plugins</groupId>
421-
<artifactId>maven-gpg-plugin</artifactId>
422-
<configuration>
423-
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
424-
<homedir>${user.dir}/.gnupg</homedir>
425-
</configuration>
426-
<executions>
427-
<execution>
428-
<id>sign-artifacts</id>
429-
<phase>verify</phase>
430-
<goals>
431-
<goal>sign</goal>
432-
</goals>
433-
</execution>
434-
</executions>
435-
</plugin>
436-
</plugins>
437-
</build>
438-
</profile>
439-
<profile>
440-
<id>travis</id>
441-
<activation>
442-
<property>
443-
<name>env.TRAVIS</name>
444-
<value>true</value>
445-
</property>
446-
</activation>
411+
<id>central-deploy</id>
447412
<build>
448413
<plugins>
449414
<plugin>
@@ -474,9 +439,27 @@
474439
<artifactId>coveralls-maven-plugin</artifactId>
475440
</plugin>
476441

477-
<!-- We need to deploy using the nexus-staging-maven-plugin specifying a stagingProfileId. This is to
478-
workaround the problem that travis uploads the artifacts using different ip addresses resulting
479-
in multiple staging repositories -->
442+
<plugin>
443+
<groupId>org.apache.maven.plugins</groupId>
444+
<artifactId>maven-gpg-plugin</artifactId>
445+
<executions>
446+
<execution>
447+
<id>sign-artifacts</id>
448+
<phase>verify</phase>
449+
<goals>
450+
<goal>sign</goal>
451+
</goals>
452+
<configuration>
453+
<!-- This is necessary for gpg to not try to use the pinentry programs -->
454+
<gpgArguments>
455+
<arg>--pinentry-mode</arg>
456+
<arg>loopback</arg>
457+
</gpgArguments>
458+
</configuration>
459+
</execution>
460+
</executions>
461+
</plugin>
462+
480463
<plugin>
481464
<groupId>org.apache.maven.plugins</groupId>
482465
<artifactId>maven-deploy-plugin</artifactId>
@@ -489,18 +472,17 @@
489472
<artifactId>nexus-staging-maven-plugin</artifactId>
490473
<executions>
491474
<execution>
492-
<id>default-deploy</id>
475+
<id>deploy-to-sonatype</id>
493476
<phase>deploy</phase>
494477
<goals>
495478
<goal>deploy</goal>
479+
<goal>release</goal>
496480
</goals>
497481
</execution>
498482
</executions>
499483
<configuration>
500-
<serverId>${repositoryId}</serverId>
484+
<serverId>oss.sonatype.org</serverId>
501485
<nexusUrl>https://oss.sonatype.org</nexusUrl>
502-
<!-- explicit matching using the staging profile id -->
503-
<stagingProfileId>1e79a0f1acc1b8</stagingProfileId>
504486
</configuration>
505487
</plugin>
506488
</plugins>
@@ -563,9 +545,9 @@
563545
</profiles>
564546
<distributionManagement>
565547
<snapshotRepository>
566-
<id>sonatype-nexus-snapshots</id>
567-
<name>Sonatype Nexus Snapshots</name>
568-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
548+
<id>github</id>
549+
<name>GitHub Packages</name>
550+
<url>https://maven.pkg.github.com/codecentric/spring-boot-admin</url>
569551
</snapshotRepository>
570552
<repository>
571553
<id>sonatype-nexus-staging</id>

spring-boot-admin-docs/deploy-gh-pages.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.

spring-boot-admin-docs/pom.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,12 @@
7676
<spring-cloud-version>${spring-cloud.version}</spring-cloud-version>
7777
<samples-dir>${basedir}/../spring-boot-admin-samples/</samples-dir>
7878
<main-dir>${basedir}/../</main-dir>
79-
<scm-tag>${env.TRAVIS_TAG}</scm-tag>
8079
<github-src>https://github.com/codecentric/spring-boot-admin/tree/master</github-src>
8180
</attributes>
8281
</configuration>
8382
</execution>
8483
</executions>
8584
</plugin>
86-
<plugin>
87-
<groupId>org.codehaus.mojo</groupId>
88-
<artifactId>exec-maven-plugin</artifactId>
89-
<executions>
90-
<execution>
91-
<id>deploy-gh-pages</id>
92-
<phase>deploy</phase>
93-
<goals>
94-
<goal>exec</goal>
95-
</goals>
96-
<configuration>
97-
<executable>./deploy-gh-pages.sh</executable>
98-
</configuration>
99-
</execution>
100-
</executions>
101-
</plugin>
10285
</plugins>
10386
</build>
10487
</project>

0 commit comments

Comments
 (0)