Skip to content

Shared GitHub Actions used in CAT/UnityCore repositories.

Notifications You must be signed in to change notification settings

mindjolt/uc-actions

Repository files navigation

UC-Actions

This repository holds common GitHub Actions that are used in the various CAT and UnityCore repositories.

Available Actions

Scans Unity test runner results for failed tests and reports them as a new, action_required check. Note that no additional check is generated if all tests are passing.

Inputs

  • name - The name to assign to the generated check (optional; defaults to test-results)
  • files - One or more XML filenames to analyze

Ensures that the CHANGELOG.md has been updated with each pull request.

Inputs

  • github_token - Valid GitHub API token (optional; will use workflow token if omitted)
  • filename - Filename to check for (optional; defaults to CHANGELOG.md)

If the JIRA ticket for a given pull request is labeled with Documentation, the pull request is scanned for documentation updates.

Inputs

  • github_token - Valid GitHub API token (optional; will use workflow token if omittted)
  • jira_user - Username for JIRA authentication (optional; will use CONFLUENCE_USER is omitted)
  • jira_password - Password for JIRA authentication (optional; will use CONFLUENCE_PASSWORD is omitted)

Creates a zip file and package.json for a given package suitable for distribution or publishing to Artifactory.

Inputs

  • artifactory_root - The root URI to use for Artifactory publishing
  • package_version - The version number being published in Semantic Versioning format
  • source_path - The absolute path to the source files to be packaged

Outputs

  • json_path - Absolute path to the generated package.json file
  • zip_path - Absolute path to the generated zip file containing the package contents

Analyses the output of automated performance tests. Depending upon the provided inputs, this action will either:

  • Generate alerts for significant changes in performance as compared to historical data
  • Ingest new metrics into the database for future comparison

Inputs

  • operation - Which operation should be performed; may be one of: (compare, ingest)
  • database_path - Path to the SQLite database that should be queried and updated
  • input_path - Path to the CSV file containing the performance metrics

Outputs

  • alerts - Any alerts that may be generated by the compare operation

A more general purpose action for posting comments to GitHub pull requests.

Inputs

  • github_token - Valid GitHub API token (optional; will use workflow token if omitted)
  • title - A title for the comment; used for selecting existing comments with mode
  • body - The body text of the comment
  • mode - One of the following options; specifies how the action should behave if an existing comment is found
    • amend - Behaves the same as replace, except the previous body is kept with strikethrough markup
    • create - Always create a new comment
    • new - Only post the comment if no existing match was found
    • replace - Replace an existing comment, if one is found, otherwise create a new comment

Checks the pull request for a JIRA ticket number and adds a comment linking back to it.

Inputs

  • github_token - Valid GitHub API token (optional; will use workflow token if omitted)

Sends a release notification message to a Slack channel.

Inputs

  • token - A valid Slack API token
  • channel - The name of the channel to post the message to
  • project_name - The name of the project being released
  • version - The version number that is being released

Create a new release tag in the repository.

Inputs

  • token - A valid GitHub API token
  • version - The release version number (used as the release tag name)
  • ref - The commit or branch being published.

Manipulate script define symbols for a Unity project externally.

Inputs

  • project_path - Path to the root of the Unity project (optional; defaults to the current workspace)
  • remove_symbols - Should symbols be removed rather than added? (optional; defaults to false)
  • symbols - List of define symbols to be added or removed, separated by , or ;
  • platforms - List of platforms to modify, separated by , or ; (optional; by default will modify all platforms in the project)

Update the changelog to commit the current unreleased changes to the new version number and create a new unreleased block.

Inputs

  • version - The version number that was released

Update the version number in the local package.json file so that it interacts correctly with the package manager.

Inputs

  • version - The new active version number of the package

Create a build using UBP. This supports both UnityCore version and UC UBP SDK version.

Inputs

  • jsonFiles - The JSON files you want to build with space delimited.
    • Files with %PROJECT_PATH% will have the UBP Saved Project settings path inserted.
    • Files that start with ./ will use what ever directory was last used.
  • platform - The platform that UBP will build for.
    • Supported Platforms: AndroidGoogle, AndroidAmazon, AndroidSamsung, AndroidFacebook, WebGLFacebook, IOS, MacOS, Win, Win64
  • unityVersion - The version of Unity to build with.
  • override - The JSON string to use for the override file.
  • (optional) buildMethod allow usage of a custom build method (IE older version of UBP).
    • Defaults to JamCity.UnityCore.UnifiedBuildPipelineSdk.Editor.Commands.BuildPlayerFromFile.
  • (optional) logFile allows setting of custom logfile.
    • Defaults to - which means it will log directly to the console.
  • (optional) unityLocation Allows setting of custom location where the different version of unity are stored.
    • Defaults to /Applications/Unity/Hub/Editor/

Example

    steps:
      - name: 'Make JSON Package'
        id: JSON_STEP
        uses: nickofthyme/object-remap@v1
        with:
          standardConfig.version: ${{github.event.inputs.version}}
          standardConfig.buildID: ${{github.run_number}}

      - name: 'Build Package'
        uses: mindjolt/uc-actions/build-with-ubp@v9
        with:
          platform: ${{github.event.inputs.platform}}
          unityVersion: ${{github.event.inputs.unityVersion}}
          files: ${{github.event.inputs.primaryBuildJob}} ./${{github.event.inputs.platform}}.json
          override: ${{steps.JSON_STEP.outputs.json}}

About

Shared GitHub Actions used in CAT/UnityCore repositories.

Resources

Stars

Watchers

Forks

Packages

No packages published