I've written a shader and am hosting it on Github right now. I'm trying to figure out how to submit it to the Godot Asset Library:

https://github.com/blackears/terrain_layered_shader

The problem is that the submission form is asking for
`The commit hash that should be downloaded. Expects 40 or 64 hexadecimal digits fully specifying a Git commit.

When using the Custom download provider, this must be set to the full download URL instead of a commit hash.`

The problem here is that there is a lot of stuff on the Github page that should not be downloaded. I've created a .zip file with the actual files that should be part of the archive (https://github.com/blackears/terrain_layered_shader/raw/master/export/terrain_layered_shader.zip). However, I can give a commit hash since that suggests to me that you are trying to download the entire GIthub repo, not just this one file.

How do I submit this? All I can think of is creating a second Github repo that just contains the files from the addon.

The problem here is that there is a lot of stuff on the Github page that should not be downloaded.

Here is the solution.

This is an example of a .gitattributes file that results in the downloaded .zip including only the addons folder:

# Normalize line endings for all files that Git considers text files.
* text=auto eol=lf

# Only include the addons folder when downloading from the Asset Library.
/**        export-ignore
/addons    !export-ignore
/addons/** !export-ignore

I used that for this asset, and it works correctly: https://godotengine.org/asset-library/asset/2307

Reference:
https://docs.godotengine.org/en/4.2/community/asset_library/submitting_to_assetlib.html#recommendations

Select the Addons / Asset Packs tab in that section of the article.


The only problem is that it prevents downloading the whole repository. But someone created a utility that lets you download a single directory or file:
https://minhaskamal.github.io/DownGit/

    DaveTheCoder The trouble with this is that I want users to be able to download the other stuff too. I don't want this repo to exist exclusively for the Asset Library. Isn't there a way to just upload a zip file to it or something?

      There is an extension for browsers that allows you to download individual selected folders — GitZip.

      Actually, a problem with that .gitattributes example is that it affects the behavior of git commands. For example, if I try to compare two commits, files outside of the addons directory are ignored.

      Correction. That example uses the export-ignore attribute, which only applies to some git commands. It doesn't affect git diff, so it probably doesn't affect comparing commits in GitHub.

      I'm looking into a potential solution: a GitHub Workflow Action.

        DaveTheCoder I'm looking into a potential solution: a GitHub Workflow Action.

        I may need a good storage and collaboration solution for a project soon.

          Tomcat I was able to find a work around by submitting my project as Custom to the Godot Asset Library and using raw links to each of the relevant files in my repo.

            By looking at some examples and experimenting, I succeeded in creating a GitHub Workflow Action that ignores .gitattributes and creates a .zip of the full repository when I create a release.

            A problem is that the .zip has too many levels:
            release-archive.zip
            .... release-archive.zip
            .... .... tmp/
            .... .... .... tmp.YbXGREv3M9/
            .... .... .... .... (repository files)

            .github/workflows/create-release-archive.yml

            name: Create Release Archive
            
            on:
              release:
                types:
                  - created
            
            jobs:
              build:
                runs-on: ubuntu-latest
                steps:
                - name: Checkout repository
                  uses: actions/checkout@v3
            
                - name: Archive repository
                  run: |
                    # Create a temporary directory
                    TMP_DIR=$(mktemp -d)
            
                    # Copy repository contents to the temporary directory, excluding specified files/directories
                    rsync -av --exclude={'.git', '.github'} . ${TMP_DIR}
            
                    # Create a ZIP archive
                    zip -r release-archive.zip ${TMP_DIR}
            
                  # Upload the ZIP archive as a GitHub Release asset
                - name: Upload Release Asset
                  uses: actions/upload-artifact@v3
                  with:
                      name: release-archive.zip
                      path: ./release-archive.zip

            Ideally, I'd like the name of the .zip to use the same convention that GitHub or the Asset Library uses when you download a .zip in the normal way, and for the .zip to contain one top-level directory that has that same name.

            Also, the created .zip is not in an obvious place in the repo's page.

            kitfox I was able to find a work around by submitting my project as Custom to the Godot Asset Library and using raw links to each of the relevant files in my repo.

            Did that take a lot of work? Did you have to add any extra files to the repository?

            Here's the final, working GitHub Workflow script that does everything I wanted. When a new GitHub release is created, it adds a .zip asset to the release page, with a name that indicates the repository name and the version tag, and containing a top level directory with the same name, and the full contents of the repository, excluding the .git* files and directories.

            name: Create Release Archive
            
            on:
              push:
                # Only run this workflow if github.ref_name has the form "x.y.z".
                tags: ["*.*.*"]
            
            jobs:
              build:
                runs-on: ubuntu-latest
                steps:
                  - name: Checkout Repository
                    uses: actions/checkout@v3
            
                    # Repository name, with owner name removed using sed (Stream Editor).
                    # Example: "octocat/octorepo" is converted to "octorepo".
                  - name: Repository Name
                    run: echo REPOSITORY=`echo ${{ github.repository }} | sed s'#.*/\(.*\)#\1#'` >> "$GITHUB_ENV"
            
                    # Example: octorepo-1.2.3-full_repository
                  - name: Archive Name
                    run: echo ARCHIVE="$REPOSITORY"-"${{ github.ref_name }}"-full_repository >> "$GITHUB_ENV"
            
                    # Example: octorepo-1.2.3-full_repository.zip
                  - name: Make Archive
                    run: |
                      # Create subdirectory, which will be archive's top level directory.
                      mkdir "$ARCHIVE"
            
                      # Copy desired files into subdirectory, excluding the subdirectory itself.
                      # rsync is used because it has an --exclude option.
                      rsync --archive --exclude={"$ARCHIVE",.gitignore,.gitattributes,.git,.github} . "$ARCHIVE"
            
                      # Make archive from subdirectory.
                      zip --recurse-paths "$ARCHIVE".zip "$ARCHIVE"
            
                  - name: Upload Asset
                    uses: softprops/action-gh-release@v1
                    with:
                      files: '*.zip'

            If you're a coding beginner, stay away from writing GitHub workflows. It will be a nightmare. 🙂

            probably a typo and 'inisia' is supposed to be 'inicia'? Como inicia would mean 'How to start' or 'How does it start'

              DaveTheCoder I'm guessing they are asking for help on getting started with doing this themselves. As in they might be struggling with the same issue and were hoping you had solved it. But that's just a guess.

              Maybe, but that's like posting "how do I use Godot" as a reply in a detailed discussion here.