name: Publish Conductor OSS Server on: release: types: - released - prereleased workflow_dispatch: inputs: version: description: 'Version to publish (e.g., v1.0.0)' required: true permissions: contents: read jobs: publish: runs-on: ubuntu-latest name: Build and Publish the server permissions: contents: write steps: - uses: actions/checkout@v7 - name: Set up Zulu JDK 21 uses: actions/setup-java@v5 with: distribution: 'zulu' java-version: '21' - name: Cache Gradle packages uses: actions/cache@v5 with: path: | ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - name: Set version id: version run: | # Use inputs.version for workflow_dispatch, or ref_name for release events VERSION="${{ github.event.inputs.version || github.ref_name }}" # Strip the 'v' prefix if present PUBLISH_VERSION="${VERSION#v}" echo "version=$PUBLISH_VERSION" >> $GITHUB_OUTPUT echo "RELEASE_VERSION=$PUBLISH_VERSION" >> $GITHUB_ENV echo "Publishing version: $PUBLISH_VERSION" - name: Build Server JAR run: | ./gradlew :conductor-server:build -x test -x spotlessCheck -x shadowJar -x :conductor-os-persistence-v3:build \ -Pversion=${{ steps.version.outputs.version }} - name: Set up Node.js uses: actions/setup-node@v6 with: node-version: 'lts/*' - name: Build ui-next and embed into server static resources run: | corepack enable cd ui-next pnpm install NODE_OPTIONS=--max-old-space-size=4096 pnpm build cd .. mkdir -p server/src/main/resources/static rm -rf server/src/main/resources/static/* cp -r ui-next/dist/. server/src/main/resources/static/ - name: Stage artifacts for Docker build run: | mkdir -p docker/server/libs cp server/build/libs/*boot*.jar docker/server/libs/conductor-server.jar - name: Login to Docker Hub Container Registry uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Build and push Server uses: docker/build-push-action@v7 with: context: . file: docker/server/Dockerfile platforms: linux/arm64,linux/amd64 push: true build-args: | PREBUILT=true tags: | conductoross/conductor:${{ env.RELEASE_VERSION }} orkesio/orkes-conductor-community-standalone:${{ env.RELEASE_VERSION }} orkesio/orkes-conductor-community:${{ env.RELEASE_VERSION }} ${{ (github.event_name == 'release' && !github.event.release.prerelease) && 'conductoross/conductor:latest' || '' }} ${{ (github.event_name == 'release' && !github.event.release.prerelease) && 'orkesio/orkes-conductor-community-standalone:latest' || '' }} ${{ (github.event_name == 'release' && !github.event.release.prerelease) && 'orkesio/orkes-conductor-community:latest' || '' }}