Skip to main content

Interaction with the Godot Asset Library

Project description

godot-asset-library-client

CI Coverage PyPi license: AGPL v3 downloads

Interact with the Godot Asset Library

This script retrieves all the information already available in the project to upload a Godot asset into the Godot asset library.

Features

  • Smart metadata gathering: do not duplicate metadata again
  • Reuses existing pending edits of the same release in the library to enable corrections.
  • Smart behaviour with existing previews
  • Shortcuts for previews hosted youtube or the repository
  • Easy integration in Github actions or any other CI/CD platform.

Install

pip install godot-asset-library-client

Usage

  • Define GODOT_ASSET_LIB_USER and GODOT_ASSET_LIB_PASSWORD environment variables. You may use a .env file with them but consider security concerns.

  • Write a yaml metadata file with content similar to this:

# asset-metadata.yaml

asset_id: '6666666' # You will obtain this id after the first publication by hand
category: "1" # 2D Tools. See available values in https://godotengine.org/asset-library/api/configure
project_license: AGPLv3
previews:

# Shortcut for youtube previews
- youtube: AD8awHLpFxs

# Shortcut for media commited in the repository
- repoimage: /screenshots/screenshot1.png
  repothumb: /screenshots/screenshot1-thumb.jpg

# If not shortcutted the preview entry should look like this
- type: image
  link: https://raw.githubusercontent.com/vokimon/godot-dice-roller/refs/heads/main/screenshots/screenshot2.png
  thumbnail: https://raw.githubusercontent.com/vokimon/godot-dice-roller/refs/heads/main/screenshots/screenshot2-thumb.jpg

# These will be concatenated and processed as description
description_files:
- README.md
- CHANGES.md

Then, from the root of your project (where project.godot resides):

godot-asset-library-client upload asset-metadata.yaml

Check that the metadata is correct, and then add the option --do:

godot-asset-library-client upload asset-metadata.yaml --do

Smart metadata guessing

If not explicitly provided, it takes most metadata from existing files in your repository so you don't have to duplicate that.

From project.godot:

  • Project name
  • Project version
  • Project description
  • Project icon
  • Godot version

From local git:

  • Commit hash
  • Current branch
  • Repository hosting (only for supported hostings)
  • Repository name (only for supported hostings)

Supported git hostings are:

  • Github
  • Bitbucket
  • Gitea

If your hosting is not listed, you always can explicit the inferred parameters. Or, better, send a PR to add your hosting. Hostings are defined in git.py and tested in git_test.py. They are quite easy to add but I do not have repositories in all of them to test, so pull requests are very welcome.

Integration with Github Actions

Provided that you already have a working asset-metadata.yaml in your repository you can add a github action to have the extension updated on each release.

Go to Github Your Project / Settings / Secrets and Variables / Actions / Repository secrets. Once there, add your secrets GODOT_ASSET_LIB_USER and GODOT_ASSET_LIB_PASSWORD.

Add this file to your repo:

# .github/workflows/publish.yml
name: Upload Plugin to Godot Asset Library

on:
  release:
    types: [published]
  workflow_dispatch: # this enables on demand execution, useful when the release fails

jobs:
  publish:
    runs-on: ubuntu-latest
    name: Publish new version to asset lib
    steps:

    - name: Checkout
      uses: actions/checkout@v2

    - name: Godot Asset Lib
      shell: bash
      run: |
        echo "GODOT_ASSET_LIB_USER=${{ secrets.GODOT_ASSET_LIB_USER }}" >> .env
        echo "GODOT_ASSET_LIB_PASSWORD=${{ secrets.GODOT_ASSET_LIB_PASSWORD }}" >> .env
        pip install --user godot-asset-library-client
        godot-asset-library-client upload asset-metadata.yaml --do

You may want to remove the --do option until you are sure you are not uploading garbage to the asset library.

TODO

Sure you can help with those:

  • Solve the emoji problem by not removing them. The blacklist is quite limited and fragile. https://github.com/godotengine/godot-asset-library/issues/345
  • Support first upload of a project
  • Auto-identify license available in repository
  • Auto-identify repo name from git remote for non github hostings
  • Auto-identify repo hosting for non github hostings

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

godot_asset_library_client-0.5.4.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

godot_asset_library_client-0.5.4-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file godot_asset_library_client-0.5.4.tar.gz.

File metadata

File hashes

Hashes for godot_asset_library_client-0.5.4.tar.gz
Algorithm Hash digest
SHA256 c2d101d2589bc275258edbd505a231342b5c9a6e15b3c072cc178063e5735a45
MD5 3b964122ebc687a3cf78d2151f8198eb
BLAKE2b-256 c7e892eba1953a0c68b607aa9299a561237c6cc40f80ee8d771704b5511ff30c

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_asset_library_client-0.5.4.tar.gz:

Publisher: python-publish.yml on vokimon/godot-asset-library-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file godot_asset_library_client-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for godot_asset_library_client-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0d673babc554e25a72dfac390d93aecec7f9763e457eb1fc768871a64ba7846b
MD5 f3d31dba6710d185930ef3a06b8ead59
BLAKE2b-256 1414fbe3d842db6d1766ad226468fe0581f1fc4da14ca807f5dca94562519e39

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_asset_library_client-0.5.4-py3-none-any.whl:

Publisher: python-publish.yml on vokimon/godot-asset-library-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page