Uploading a Package to pckgs.io with Github Actions
This quick guide walks you through the process of uploading your Unity packages to pckgs.io using GitHub Actions. By automating the upload with GitHub workflows, you can seamlessly publish your packages from your repository, ensuring consistent versioning and making them available to your team or the wider Unity community with minimal manual effort.
Prerequisites
Before uploading a package, ensure you have the following:
Account: You need a pckgs.io account to access and manage your organization and packages. If you don’t have one yet, please Create an Account.
Organization: All packages in pckgs.io must belong to an organization. Refer to our Create An Organization documentation to create one if needed.
For private packages, the organization needs an active subscription.
Access Token: This is required to verify your identity to keep everything secure. Refer to our Create an Access Token documentation to create one if needed.
Unity Package: You need a Unity package created within your repository, ready for upload. If you haven’t created one yet, see our Create a Package guide for detailed instructions.
Uploading the Package
Create a workflow file in your repository under .github/workflows/, for example .github/workflows/upload-package.yml.
In this workflow YAML file, include a step that uses the pckgs-io/upload-unity-package@v1 action. This step will handle the package upload process automatically. See the example below for how to add this step.
Make sure your repository has a secret named PCKGS_ACCESS_TOKEN that contains your pckgs.io access token for authentication.
Example Workflow File
name: Upload Unity Package to pckgs.io
on:
push:
branches: [main]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Upload package to pckgs.io
uses: pckgs-io/upload-unity-package@v1
with:
package_folder: Assets/Package
access_token: ${{ secrets.PCKGS_ACCESS_TOKEN }}
is_public: true
version: "1.1.${{ github.run_number }}"
contributor_email: ${{ github.event.pusher.email }}
contributor_name: ${{ github.event.pusher.name }}
contributor_url: https://github.com/${{ github.actor }}
Parameters
Below are the inputs you can provide to the pckgs-io/upload-unity-package@v1 action step.
Parameter | Required | Description |
---|---|---|
package_folder | Yes | Relative path to the Unity package folder within your repository that will be compressed and uploaded. |
access_token | Yes | Access token used to authenticate with pckgs.io. |
is_public | Yes | Boolean (true or false) specifying if the package should be publicly accessible. This setting applies only when the package is created for the first time. |
version | No | Version of the package (e.g., 1.0.0). If omitted, the package version must be defined in the package manifest. |
contributor_email | No | Email address of the contributor uploading the package. |
contributor_name | No | Name or nickname of the contributor. |
contributor_url | No | URL to the contributor’s profile (e.g., GitHub, personal website). |
Make sure to fill the required fields, and optionally provide contributor information to track who uploaded the package.
For more details on creating workflows, check out the official GitHub Actions quickstart guide: GitHub Actions Quickstart.
Need Further Assistance?
Should you encounter any issues or have questions about the upload process, please feel free to contact us here or email us at [email protected].