Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated deployment actions #320

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
java-version: 11

- name: Build with Maven
run: ./mvnw package
run: mvn package

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java11-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
java-version: 11
- name: Build with Maven
run: ./mvnw -B package
run: mvn -B package
29 changes: 29 additions & 0 deletions .github/workflows/java11-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish JRE11 to the Maven Central
on:
release:
types: [created]

workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
environment: maven-central
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Publish package
run: mvn -B -Pmaven-central -Dgpg.passphrase=${{secrets.MAVEN_GPG_PASSPHRASE}} -s maven-central-settings.xml deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/java8-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
java-version: 1.8
- name: Build with Maven
run: ./mvnw -f pom_jre8.xml -B package
run: mvn -f pom_jre8.xml -B package
29 changes: 29 additions & 0 deletions .github/workflows/java8-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish JRE8 to the Maven Central
on:
release:
types: [created]

workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
environment: maven-central
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
server-id: ossrh
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Publish package
run: mvn -f pom_jre8.xml -B -Pmaven-central -Dgpg.passphrase=${{secrets.MAVEN_GPG_PASSPHRASE}} -s maven-central-settings.xml deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ Fork and clone the project repository.

```bash
> cd titanium-json-ld
> ./mvnw clean package
> mvn clean package
```

#### Java 8

```bash
> cd titanium-json-ld
> ./mvnw -f pom_jre8.xml clean package
> mvn -f pom_jre8.xml clean package
```

## Resources
Expand Down
12 changes: 12 additions & 0 deletions maven-central-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>ossrh</id>
<username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>
Loading
Loading