deploy #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NEXUS_USER | |
# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java | |
# byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8); | |
# String encoded = new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8); | |
# System.out.println(encoded); | |
# GPG_PASSPHRASE | |
# GPG_KEY64 (base64) | |
# gpg --export-secret-keys --armor KEY_ID | openssl base64 | pbcopy | |
# GRADLE_KEY | |
# GRADLE_SECRET | |
name: deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
to_publish: | |
description: 'What to publish' | |
required: true | |
default: 'all' | |
type: choice | |
options: | |
- plugin-gradle | |
- plugin-maven | |
- all | |
- lib | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: deploy | |
permissions: | |
contents: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }} | |
ORG_GRADLE_PROJECT_nexus_pass64: ${{ secrets.NEXUS_PASS64 }} | |
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: jdk 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: 'temurin' | |
- name: gradle caching | |
uses: gradle/actions/setup-gradle@v4 | |
- name: git fetch origin main | |
run: git fetch origin main | |
- name: publish all | |
if: "${{ github.event.inputs.to_publish == 'all' }}" | |
run: | | |
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache | |
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }} --stacktrace --warning-mode all --no-configuration-cache | |
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache | |
- name: publish just plugin-gradle | |
if: "${{ github.event.inputs.to_publish == 'plugin-gradle' }}" | |
run: | | |
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }} --stacktrace --warning-mode all --no-configuration-cache | |
- name: publish just plugin-maven | |
if: "${{ github.event.inputs.to_publish == 'plugin-maven' }}" | |
run: | | |
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache | |
- name: publish just lib | |
if: "${{ github.event.inputs.to_publish == 'lib' }}" | |
run: | | |
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache | |
- run: git checkout main | |
- run: git merge release --ff-only | |
- run: git push origin main |