Skip to content

Commit

Permalink
Setup release workflow for dbutils scala (#13)
Browse files Browse the repository at this point in the history
* Setup release workflow for dbutils scala

* generating source and doc jars

* fmt
  • Loading branch information
mgyucht authored Aug 31, 2023
1 parent d82fa33 commit 67a5a3d
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 25 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 8
server-id: ossrh
distribution: "adopt"
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Publish to the Maven Central Repository
run: mvn -DskipTests=true --batch-mode deploy
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: target/*.jar
70 changes: 45 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,52 +118,45 @@
</configuration>
<executions>
<execution>
<id>scala-compile</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Sign the artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<id>prepare-release-assets</id>
<goals>
<goal>sign</goal>
<goal>add-source</goal>
</goals>
<phase>verify</phase>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<!-- Maven source and JavaDoc plugin to meet Maven Central's requirements -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<id>generate-doc-jar</id>
<goals>
<goal>jar-no-fork</goal>
<goal>doc-jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<!-- Sign the artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>attach-javadocs</id>
<id>sign-artifacts</id>
<goals>
<goal>jar</goal>
<goal>sign</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -298,6 +291,33 @@
</pom>
</configuration>
</plugin>
<!-- Maven source plugin to meet Maven Central's requirements -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>generate-source-jar</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Release plugin -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- change to true after testing -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
17 changes: 17 additions & 0 deletions private_key.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----

lIYEYrG+GhYJKwYBBAHaRw8BAQdAyVsro1W/bO8S/DQcCZIlY/d2N8IqZLFUvIYW
44YRdx7+BwMCE0Kle/WaiJz7FIm8PpyhwHSU08Mw5uMGyFOBb9xgiVuXLwwyPa2I
F/VNZi9SUbvXB48aC4kT5w/RjwpRroMjaCljwD2Fw/eTuoJCQWX0o7QiTWlsZXMg
WXVjaHQgPG1pbGVzQGRhdGFicmlja3MuY29tPoiTBBMWCgA7FiEEuTs07YMgrzFk
QsGXEP9eWKOmkr4FAmKxvhoCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AA
CgkQEP9eWKOmkr7vwQD+JRhNiCX9+e8+ne/TpGanT7A90t+haKHoJmP46SLZNH0A
/3axdvSIJUtH5YLro+wfTvj7ePdSqgeQFPnpLMild6IKnIsEYrG+GhIKKwYBBAGX
VQEFAQEHQAFNIj6I1As8GdUQ/HH+nC886O6Ax75B2/TX5ADMKKhYAwEIB/4HAwK0
bJqlzjkK4fvuNBC+pcNfY4J6EeCLf/u08kesry8hPq38x7tv/7VWbadmoWxUwIkc
VNDEbxL2WpuW4hCjq+gV8IggP7LxJa4/AKKw7hxCiHgEGBYKACAWIQS5OzTtgyCv
MWRCwZcQ/15Yo6aSvgUCYrG+GgIbDAAKCRAQ/15Yo6aSvtGyAQC1KVUQeuQug4te
s0wU6UYAUGhcxAuWrPj3YQwCpn3VtwD9Gec12xj2FgTX8iqA4GDRvgDSl0CuDIiV
CdQyu5eXkQI=
=+tlo
-----END PGP PRIVATE KEY BLOCK-----

0 comments on commit 67a5a3d

Please sign in to comment.