Skip to content

Manually Publish Release #1

Manually Publish Release

Manually Publish Release #1

name: Manually Publish Release
on:
workflow_dispatch:
branches:
- main
jobs:
build:
name: Manually publish release
runs-on: ubuntu-latest
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false
#services:
# flow-emulator:
# image: gcr.io/flow-container-registry/emulator
# env:
# FLOW_VERBOSE: true
# FLOW_PORT: 3569
# FLOW_INTERVAL: 5s
# FLOW_PERSIST: false
# ports:
# - 3569:3569
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '21'
java-package: jdk
distribution: 'adopt'
- name: Install flow emulator
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
- name: Make gradle executable
run: chmod +x ./gradlew
- name: Build
id: build
run: ./gradlew --warning-mode all check build -x test -x integrationTest
- name: Publish release
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false
ORG_GRADLE_PROJECT_mavenCentralUsername: '${{ secrets.FLOW_JVM_SDK_SONATYPE_USERNAME }}'
ORG_GRADLE_PROJECT_mavenCentralPassword: '${{ secrets.FLOW_JVM_SDK_SONATYPE_PASSWORD }}'
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.FLOW_JVM_SDK_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.FLOW_JVM_SDK_SIGNING_PASSWORD }}
run: |
if [[ "${{ secrets.FLOW_JVM_SDK_CICD_PUBLISH_ENABLED }}" != "true" ]];
then
exit 0;
fi
./gradlew \
-Psigning.key="${{ secrets.FLOW_JVM_SDK_SIGNING_KEY }}" \
-Psigning.password="${{ secrets.FLOW_JVM_SDK_SIGNING_PASSWORD }}" \
:sdk:publishAndReleaseToMavenCentral --no-configuration-cache