Skip to content

Commit

Permalink
Enable publish
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Jul 24, 2024
1 parent e9dbda3 commit 4f2e098
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/publish-ghp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Integration Test

on:
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
force:
type: choice
description: Retry Publish Version
options:
- No
- Yes
jobs:
public-ghp:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
#When run on push tags, force is '', default for workflow_dispatch is No so you can't trigger without a double action
DO_DEPLOYMENT: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.force == 'Yes' }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
cache: 'maven'

- name: Build with Maven
env:
KITEWORKS_BASE_URI: ${{ secrets.KITEWORKS_BASE_URI }}
KITEWORKS_CLIENT_ID: ${{ secrets.KITEWORKS_CLIENT_ID }}
KITEWORKS_CLIENT_SECRET: ${{ secrets.KITEWORKS_CLIENT_SECRET }}
KITEWORKS_SIGNATURE_KEY: ${{ secrets.KITEWORKS_SIGNATURE_KEY }}
KITEWORKS_USER_ID: ${{ secrets.KITEWORKS_USER_ID }}
KITEWORKS_CLIENT_APP_SCOPES: ${{ secrets.KITEWORKS_CLIENT_APP_SCOPES }}
KITEWORKS_REDIRECT_URI: ${{ secrets.KITEWORKS_REDIRECT_URI }}
KITEWORKS_ACCESS_TOKEN_URI: ${{ secrets.KITEWORKS_ACCESS_TOKEN_URI }}
run: mvn clean install -Dspring.profiles.active=cicd

- name: Publish package
if: ${{ env.DO_DEPLOYMENT == 'true' }}
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KITEWORKS_BASE_URI: ${{ secrets.KITEWORKS_BASE_URI }}
KITEWORKS_CLIENT_ID: ${{ secrets.KITEWORKS_CLIENT_ID }}
KITEWORKS_CLIENT_SECRET: ${{ secrets.KITEWORKS_CLIENT_SECRET }}
KITEWORKS_SIGNATURE_KEY: ${{ secrets.KITEWORKS_SIGNATURE_KEY }}
KITEWORKS_USER_ID: ${{ secrets.KITEWORKS_USER_ID }}
KITEWORKS_CLIENT_APP_SCOPES: ${{ secrets.KITEWORKS_CLIENT_APP_SCOPES }}
KITEWORKS_REDIRECT_URI: ${{ secrets.KITEWORKS_REDIRECT_URI }}
KITEWORKS_ACCESS_TOKEN_URI: ${{ secrets.KITEWORKS_ACCESS_TOKEN_URI }}

- name: Publish - Skipped
if: ${{ env.DO_DEPLOYMENT != 'true' }}
run: |
echo "### Publish skipped" >> $GITHUB_STEP_SUMMARY
echo "DO_DEPLOYMENT( ${{ env.DO_DEPLOYMENT }} ): github.event_name: ${{ github.event_name != 'workflow_dispatch'}} || github.event.inputs.force: ${{ github.event.inputs.force == 'Yes' }}" >> $GITHUB_STEP_SUMMARY
# - name: Set up Java for publishing to Maven Central Repository
# uses: actions/setup-java@v4
# with:
# java-version: '11'
# distribution: 'temurin'
# server-id: ossrh
# server-username: MAVEN_USERNAME
# server-password: MAVEN_PASSWORD
# - name: Publish to the Maven Central Repository
# run: mvn --batch-mode deploy
# env:
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
# KITEWORKS_BASE_URI: ${{ secrets.KITEWORKS_BASE_URI }}
# KITEWORKS_CLIENT_ID: ${{ secrets.KITEWORKS_CLIENT_ID }}
# KITEWORKS_CLIENT_SECRET: ${{ secrets.KITEWORKS_CLIENT_SECRET }}
# KITEWORKS_SIGNATURE_KEY: ${{ secrets.KITEWORKS_SIGNATURE_KEY }}
# KITEWORKS_USER_ID: ${{ secrets.KITEWORKS_USER_ID }}
# KITEWORKS_CLIENT_APP_SCOPES: ${{ secrets.KITEWORKS_CLIENT_APP_SCOPES }}
# KITEWORKS_REDIRECT_URI: ${{ secrets.KITEWORKS_REDIRECT_URI }}
# KITEWORKS_ACCESS_TOKEN_URI: ${{ secrets.KITEWORKS_ACCESS_TOKEN_URI }}
8 changes: 8 additions & 0 deletions kiteworks-native-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
<spotless.version>2.27.2</spotless.version>
</properties>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/qld-gov-au/kiteworks-integration</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
Expand Down
8 changes: 8 additions & 0 deletions kiteworks-spring-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/qld-gov-au/kiteworks-integration</url>
</repository>
</distributionManagement>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
<artifactId>kiteworks_integration</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/qld-gov-au/kiteworks-integration</url>
</repository>
</distributionManagement>

<modules>
<module>kiteworks-spring-service</module>
<module>kiteworks-native-client</module>
Expand Down

0 comments on commit 4f2e098

Please sign in to comment.