Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9e0751f
Added installer
IvanMurzak Sep 24, 2025
634e754
Add initial test files and assembly definitions for Editor and Runtim…
IvanMurzak Sep 24, 2025
e2de1d7
Add GitHub Actions workflows for release and testing of Unity plugin
IvanMurzak Sep 24, 2025
6316a55
Update package description for clarity and detail
IvanMurzak Sep 24, 2025
846a10b
Remove redundant image from README.md
IvanMurzak Sep 24, 2025
cd13ef6
Update Unity test versions in CI workflows for consistency and accuracy
IvanMurzak Sep 24, 2025
4b02b15
Add stability status section to README.md with Unity version test res…
IvanMurzak Sep 24, 2025
e7a6e51
Fix file paths in ManifestInstallerTests and remove unused reference …
IvanMurzak Sep 24, 2025
04b356d
Update release note title to include full project name
IvanMurzak Sep 24, 2025
bf7b60d
Update Unity version from 2019.2.1f1 to 2019.2.21f1 in workflow files…
IvanMurzak Sep 24, 2025
cddcf1e
Update Unity version in workflows and README to 2019.4.40f1
IvanMurzak Sep 24, 2025
e324a37
Add Unity Parallax Effect image to README and remove unused small gif
IvanMurzak Sep 24, 2025
c30dd14
Update project settings and files to Unity version 2019.4.40f1; add X…
IvanMurzak Sep 24, 2025
d4435e2
Refactor package dependencies and remove unused scoped registries in …
IvanMurzak Sep 24, 2025
9770c7b
Add conditional checks to skip Unity 2019 tests on Windows in CI work…
IvanMurzak Sep 24, 2025
19f58ea
Skip Unity 2019 tests on Windows in CI workflow
IvanMurzak Sep 24, 2025
0ab4e18
Fix image link for Unity Parallax Effect in README
IvanMurzak Sep 24, 2025
1bef777
Revert version number in package.json from 2.0.0 to 1.4.1
IvanMurzak Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
379 changes: 379 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,379 @@
name: release

on:
push:
branches:
- main

jobs:
setup:
runs-on: ubuntu-latest
outputs:
UnityProjectPath: ${{ steps.vars.outputs.UnityProjectPath }}
UnityPackageRoot: ${{ steps.vars.outputs.UnityPackageRoot }}
InstallerProjectPath: ${{ steps.vars.outputs.InstallerProjectPath }}
InstallerFileName: ${{ steps.vars.outputs.InstallerFileName }}
InstallerExportMethod: ${{ steps.vars.outputs.InstallerExportMethod }}
InstallerUnityVersion: ${{ steps.vars.outputs.InstallerUnityVersion }}
steps:
- id: vars
run: |
echo "UnityProjectPath=./Unity-Package" >> $GITHUB_OUTPUT
echo "UnityPackageRoot=./Assets/root" >> $GITHUB_OUTPUT
echo "InstallerProjectPath=./Installer" >> $GITHUB_OUTPUT
echo "InstallerFileName=Gyroscope-Parallax-Installer" >> $GITHUB_OUTPUT
echo "InstallerExportMethod=com.IvanMurzak.Unity.Gyroscope.Parallax.Installer.PackageExporter.ExportPackage" >> $GITHUB_OUTPUT
echo "InstallerUnityVersion=2020.3.36f1" >> $GITHUB_OUTPUT

check-version-tag:
needs: setup
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.current-version }}
prev_tag: ${{ steps.prev_tag.outputs.tag }}
tag_exists: ${{ steps.tag_exists.outputs.exists }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Get version from package.json
id: get_version
uses: martinbeentjes/npm-get-version-action@v1.3.1
with:
path: ${{ needs.setup.outputs.UnityProjectPath }}/${{ needs.setup.outputs.UnityPackageRoot }}

- name: Find previous version tag
id: prev_tag
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Check if tag exists
id: tag_exists
uses: mukunku/tag-exists-action@v1.6.0
with:
tag: ${{ steps.get_version.outputs.current-version }}

build-unity-installer:
runs-on: [ubuntu-latest]
needs: [setup, check-version-tag]
if: needs.check-version-tag.outputs.tag_exists == 'false'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Unity Library
uses: actions/cache@v4
with:
path: ${{ needs.setup.outputs.InstallerProjectPath }}/Library
key: Library-Unity-Installer

- name: Test Unity Installer (EditMode)
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ needs.setup.outputs.InstallerProjectPath }}
unityVersion: ${{ needs.setup.outputs.InstallerUnityVersion }}
customImage: 'unityci/editor:ubuntu-${{ needs.setup.outputs.InstallerUnityVersion }}-base-3'
testMode: editmode
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: Unity Installer EditMode Test Results
artifactsPath: artifacts-installer-editmode
customParameters: -CI true -GITHUB_ACTIONS true

- name: Clean Unity artifacts and reset git state
run: |
# Force remove Unity generated files with restricted permissions
sudo rm -rf ${{ needs.setup.outputs.InstallerProjectPath }}/Logs/ || true
sudo rm -rf ${{ needs.setup.outputs.InstallerProjectPath }}/Temp/ || true
sudo rm -rf ./artifacts-installer-editmode/ || true

# Reset only tracked files to their committed state
git reset --hard HEAD
echo "Cleaned Unity artifacts and reset tracked files"

- name: Export Unity Package
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ needs.setup.outputs.InstallerProjectPath }}
unityVersion: ${{ needs.setup.outputs.InstallerUnityVersion }}
customImage: 'unityci/editor:ubuntu-${{ needs.setup.outputs.InstallerUnityVersion }}-base-3'
buildName: ${{ needs.setup.outputs.InstallerFileName }}
buildsPath: build
buildMethod: ${{ needs.setup.outputs.InstallerExportMethod }}
customParameters: -CI true -GITHUB_ACTIONS true

- name: Upload Unity Package as artifact
uses: actions/upload-artifact@v4
with:
name: unity-installer-package
path: ${{ needs.setup.outputs.InstallerProjectPath }}/build/${{ needs.setup.outputs.InstallerFileName }}.unitypackage

# --- UNITY TESTS ---
# -------------------

# --- EDIT MODE ---

test-unity-2019-4-40f1-editmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2019.4.40f1'
testMode: 'editmode'
secrets: inherit

test-unity-2020-3-48f1-editmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2020.3.48f1'
testMode: 'editmode'
secrets: inherit

test-unity-2021-3-45f1-editmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2021.3.45f1'
testMode: 'editmode'
secrets: inherit

test-unity-2022-3-62f1-editmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2022.3.62f1'
testMode: 'editmode'
secrets: inherit

test-unity-6000-0-58f1-editmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '6000.0.58f1'
testMode: 'editmode'
secrets: inherit

# --- PLAY MODE ---

test-unity-2019-4-40f1-playmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2019.4.40f1'
testMode: 'playmode'
secrets: inherit

test-unity-2020-3-48f1-playmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2020.3.48f1'
testMode: 'playmode'
secrets: inherit

test-unity-2021-3-45f1-playmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2021.3.45f1'
testMode: 'playmode'
secrets: inherit

test-unity-2022-3-62f1-playmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2022.3.62f1'
testMode: 'playmode'
secrets: inherit

test-unity-6000-0-58f1-playmode:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '6000.0.58f1'
testMode: 'playmode'
secrets: inherit

# --- STANDALONE ---

test-unity-2019-4-40f1-standalone:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2019.4.40f1'
testMode: 'standalone'
secrets: inherit

test-unity-2020-3-48f1-standalone:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2020.3.48f1'
testMode: 'standalone'
secrets: inherit

test-unity-2021-3-45f1-standalone:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2021.3.45f1'
testMode: 'standalone'
secrets: inherit

test-unity-2022-3-62f1-standalone:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '2022.3.62f1'
testMode: 'standalone'
secrets: inherit

test-unity-6000-0-58f1-standalone:
needs: [setup, build-unity-installer]
uses: ./.github/workflows/test_unity_plugin.yml
with:
projectPath: ${{ needs.setup.outputs.UnityProjectPath }}
unityVersion: '6000.0.58f1'
testMode: 'standalone'
secrets: inherit

# -------------------

release-unity-plugin:
runs-on: ubuntu-latest
needs: [
check-version-tag,
build-unity-installer,
test-unity-2019-4-40f1-editmode,
test-unity-2019-4-40f1-playmode,
test-unity-2019-4-40f1-standalone,
test-unity-2020-3-48f1-editmode,
test-unity-2020-3-48f1-playmode,
test-unity-2020-3-48f1-standalone,
test-unity-2021-3-45f1-editmode,
test-unity-2021-3-45f1-playmode,
test-unity-2021-3-45f1-standalone,
test-unity-2022-3-62f1-editmode,
test-unity-2022-3-62f1-playmode,
test-unity-2022-3-62f1-standalone,
test-unity-6000-0-58f1-editmode,
test-unity-6000-0-58f1-playmode,
test-unity-6000-0-58f1-standalone
]
if: needs.check-version-tag.outputs.tag_exists == 'false'
outputs:
version: ${{ needs.check-version-tag.outputs.version }}
success: ${{ steps.rel_desc.outputs.success }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Generate release description
id: rel_desc
env:
GH_TOKEN: ${{ github.token }}
run: |
set -e
version=${{ needs.check-version-tag.outputs.version }}
prev_tag=${{ needs.check-version-tag.outputs.prev_tag }}
repo_url="https://github.com/${GITHUB_REPOSITORY}"
today=$(date +'%B %e, %Y')

echo "repo_url: $repo_url"
echo "today: $today"

echo "# Unity Gyroscope Parallax $version" > release.md
echo "**Released:** *$today*" >> release.md

echo "" >> release.md
echo "---" >> release.md
echo "" >> release.md

if [ -n "$prev_tag" ]; then
echo "## Comparison" >> release.md
echo "See every change: [Compare $prev_tag...$version]($repo_url/compare/$prev_tag...$version)" >> release.md

echo "" >> release.md
echo "---" >> release.md
echo "" >> release.md

echo "## Commit Summary (Newest → Oldest)" >> release.md
for sha in $(git log --pretty=format:'%H' $prev_tag..HEAD); do
username=$(gh api repos/${GITHUB_REPOSITORY}/commits/$sha --jq '.author.login // .commit.author.name')
message=$(git log -1 --pretty=format:'%s' $sha)
short_sha=$(git log -1 --pretty=format:'%h' $sha)
echo "- [\`$short_sha\`]($repo_url/commit/$sha) — $message by @$username" >> release.md
done
fi

printf "release_body<<ENDOFRELEASEBODY\n%s\nENDOFRELEASEBODY\n" "$(cat release.md)" >> $GITHUB_OUTPUT
echo "success=true" >> $GITHUB_OUTPUT

- name: Create Tag and Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.check-version-tag.outputs.version }}
name: ${{ needs.check-version-tag.outputs.version }}
body: ${{ steps.rel_desc.outputs.release_body }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-unity-installer:
runs-on: ubuntu-latest
needs: [setup, release-unity-plugin]
steps:
- name: Download Unity Package artifact
uses: actions/download-artifact@v4
with:
name: unity-installer-package
path: ./

- name: Upload Unity Package to Release
uses: softprops/action-gh-release@v2
with:
files: ./${{ needs.setup.outputs.InstallerFileName }}.unitypackage
tag_name: ${{ needs.release-unity-plugin.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Cleanup job to remove build artifacts after publishing
cleanup-artifacts:
runs-on: ubuntu-latest
needs: [publish-unity-installer]
if: always()
steps:
- name: Delete Unity Package artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: unity-installer-package
failOnError: false
continue-on-error: true
Loading
Loading