Skip to content

Commit

Permalink
Went back to release events in publish_assets. Also added workflow_di…
Browse files Browse the repository at this point in the history
…spatch (manual) but limited it to the Sonatype upload.
  • Loading branch information
jcpitre committed Oct 19, 2023
1 parent d73b1e3 commit 7529720
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/publish_assets.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Upload Release Assets

on:
push:
tags:
- 'v[0-9]*'
release:
types: [ prereleased, released ]
workflow_dispatch:

jobs:
upload-release-assets:
Expand All @@ -22,9 +22,11 @@ jobs:
distribution: 'zulu'

- name: Generate CLI jar
if: github.event_name == 'release'
run: ./gradlew shadowJar

- name: Upload JAR Asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,9 +37,11 @@ jobs:
asset_content_type: application/java-archive

- name: Generate rules.json
if: github.event_name == 'release'
run: ./gradlew webClientRulesJSON

- name: Upload rules.json asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -48,12 +52,15 @@ jobs:
asset_content_type: application/json

- name: Generate JavaDocs
if: github.event_name == 'release'
run: ./gradlew aggregateJavadoc

- name: Zip JavaDocs
if: github.event_name == 'release'
run: zip -r javadocs.zip build/docs/aggregateJavadoc

- name: Upload zipped Javadocs
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -70,7 +77,7 @@ jobs:
# gradle will build, sign then upload artifacts to a Sonatype staging repo.
# See https://s01.oss.sonatype.org for accessing these repos.
# At this point it should manually be closed, which will trigger acceptance tests for maven central (but not transfer yet)
# Once closed, thew repo is available for testing.
# Once closed, the repo is available for testing.
# After testing, it can be manually promoted on the sonatype site, which will then publish to maven central.
# Note than once in maven central a release cannot be removed or altered.

Expand All @@ -84,7 +91,7 @@ jobs:
MAVEN_GPG_PRIVATE_KEY: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/yztcx47yzp4vizjyaq7ulvkgoi/Private Key"
MAVEN_GPG_PASSPHRASE: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/yztcx47yzp4vizjyaq7ulvkgoi/password"

- name: Build and Publish
- name: Build and Publish to Sonatype
run: |
# The gradle java verifying plugin does not work with java 17.
# Don't verify since it has already been done when the PR was created.
Expand Down

0 comments on commit 7529720

Please sign in to comment.