1+ name : spt-development-logging-spring-boot
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ build :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - uses : actions/checkout@v3
11+
12+ - name : Set up JDK 18
13+ uses : actions/setup-java@v3
14+ with :
15+ java-version : ' 18'
16+ distribution : ' adopt'
17+
18+ - name : Build with Maven
19+ run : mvn clean install -B
20+
21+ - name : Mutation testing
22+ run : mvn org.pitest:pitest-maven:mutationCoverage -B
23+
24+ release :
25+ runs-on : ubuntu-latest
26+ needs : build
27+ if : github.ref == 'refs/heads/main'
28+
29+ steps :
30+ - uses : actions/checkout@v3
31+
32+ - name : Set up JDK 18
33+ uses : actions/setup-java@v3
34+ with :
35+ java-version : ' 18'
36+ distribution : ' adopt'
37+
38+ - name : Determine version
39+ run : echo "POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec | sed -e 's/-SNAPSHOT//')" >> $GITHUB_ENV
40+
41+ - name : Import GPG key
42+ id : import_gpg
43+ uses : crazy-max/ghaction-import-gpg@v5
44+ with :
45+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
46+ passphrase : ${{ secrets.GPG_PASSPHRASE }}
47+
48+ - name : Configure Git User for updating version
49+ run : |
50+ git config user.email "actions@github.com"
51+ git config user.name "GitHub Actions"
52+
53+ - name : Create release
54+ run : mvn --settings .github/maven-settings.xml release:prepare release:perform -DskipTests -Prelease -B
55+ env :
56+ OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
57+ OSSRH_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
58+ GIT_HUB_USERNAME : ${{ secrets.GIT_HUB_USERNAME }}
59+ GIT_HUB_TOKEN : ${{ secrets.GIT_HUB_TOKEN }}
60+ GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
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 : ${{ env.POM_VERSION }}
69+ release_name : ${{ env.POM_VERSION }}
70+ draft : false
71+ prerelease : false
72+
73+ - name : Upload GitHub release asset
74+ id : upload-release-asset
75+ uses : actions/upload-release-asset@v1
76+ env :
77+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+ with :
79+ upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
80+ asset_path : spt-development-logging-spring-boot-autoconfigure/target/spt-development-logging-spring-boot-autoconfigure-${{ env.POM_VERSION }}.jar
81+ asset_name : spt-development-logging-spring-boot-autoconfigure-${{ env.POM_VERSION }}.jar
82+ asset_content_type : application/java-archive
83+
84+ - name : Upload GitHub release asset
85+ id : upload-release-asset-2
86+ uses : actions/upload-release-asset@v1
87+ env :
88+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89+ with :
90+ upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
91+ asset_path : spt-development-logging-spring-boot-starter/target/spt-development-logging-spring-boot-starter-${{ env.POM_VERSION }}.jar
92+ asset_name : spt-development-logging-spring-boot-starter-${{ env.POM_VERSION }}.jar
93+ asset_content_type : application/java-archive
0 commit comments