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
- Go to your GitHub repository → Settings → Secrets
- Add
HYTALE_API_TOKENwith your API token from your dashboard - Add
HYTALE_PROJECT_IDwith your project ID - 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:
- tagsJenkins
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}"
'''
}
}