UnifiedHytale Docs

CI/CD Integration

Automate version uploads in your build pipeline.

Automate version uploads in your build pipeline.

GitHub Actions Example

name: Release

on:
  release:
    types: [published]

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Build
        run: ./gradlew build

      - name: Upload to UnifiedHytale
        env:
          HYTALE_API_TOKEN: ${{ secrets.HYTALE_API_TOKEN }}
          PROJECT_ID: ${{ secrets.HYTALE_PROJECT_ID }}
        run: |
          curl -X POST "https://www.unifiedhytale.com/api/v1/projects/$PROJECT_ID/versions" \
            -H "Authorization: Bearer $HYTALE_API_TOKEN" \
            -F "file=@./build/libs/my-plugin.jar" \
            -F "version_number=${{ github.event.release.tag_name }}" \
            -F "version_name=${{ github.event.release.name }}" \
            -F "changelog=${{ github.event.release.body }}" \
            -F "game_versions=1.0,1.1,1.2"

Setup Steps

  1. Go to your GitHub repository → Settings → Secrets
  2. Add HYTALE_API_TOKEN with your API token from your dashboard
  3. Add HYTALE_PROJECT_ID with your project ID
  4. Create a new release to trigger the workflow

Other CI Systems

The same curl command works with any CI system:

GitLab CI

upload:
  stage: deploy
  script:
    - |
      curl -X POST "https://www.unifiedhytale.com/api/v1/projects/$PROJECT_ID/versions" \
        -H "Authorization: Bearer $HYTALE_API_TOKEN" \
        -F "file=@./build/libs/my-plugin.jar" \
        -F "version_number=$CI_COMMIT_TAG"
  only:
    - tags

Jenkins

stage('Upload') {
    steps {
        sh '''
            curl -X POST "https://www.unifiedhytale.com/api/v1/projects/${PROJECT_ID}/versions" \
                -H "Authorization: Bearer ${HYTALE_API_TOKEN}" \
                -F "file=@./build/libs/my-plugin.jar" \
                -F "version_number=${VERSION}"
        '''
    }
}

On this page