Skip to content

Commit 6c591ba

Browse files
committed
convert action to type script
1 parent 9462469 commit 6c591ba

112 files changed

Lines changed: 28411 additions & 9601 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 24
16+
cache: npm
17+
18+
- run: npm ci
19+
- run: npm run build
20+
21+
- name: verify dist is up to date
22+
run: |
23+
git status --porcelain
24+
git diff --exit-code
25+
26+
smoke:
27+
runs-on: ubuntu-latest
28+
needs: build
29+
timeout-minutes: 5
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Prepare fake Unity project (with revision)
34+
shell: bash
35+
run: |
36+
set -euo pipefail
37+
mkdir -p tmp/ProjectSettings
38+
cat > tmp/ProjectSettings/ProjectVersion.txt << 'EOF'
39+
m_EditorVersionWithRevision: 2021.3.0f1 (abcdef123456)
40+
EOF
41+
42+
- name: Run action
43+
id: unity
44+
uses: ./
45+
with:
46+
project-path: tmp
47+
48+
- name: Assert outputs
49+
shell: bash
50+
run: |
51+
set -euo pipefail
52+
[[ "${{ steps.unity.outputs.unity-version }}" == "2021.3.0f1" ]]
53+
[[ "${{ steps.unity.outputs.unity-version-changeset }}" == "abcdef123456" ]]

.gitignore

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional stylelint cache
57+
.stylelintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variable files
69+
.env
70+
.env.*
71+
!.env.example
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
out
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
84+
# Gatsby files
85+
.cache/
86+
# Comment in the public line in if your project uses Gatsby and not Next.js
87+
# https://nextjs.org/blog/next-9-1#public-directory-support
88+
# public
89+
90+
# vuepress build output
91+
.vuepress/dist
92+
93+
# vuepress v2.x temp and cache directory
94+
.temp
95+
.cache
96+
97+
# Sveltekit cache directory
98+
.svelte-kit/
99+
100+
# vitepress build output
101+
**/.vitepress/dist
102+
103+
# vitepress cache directory
104+
**/.vitepress/cache
105+
106+
# Docusaurus cache and generated files
107+
.docusaurus
108+
109+
# Serverless directories
110+
.serverless/
111+
112+
# FuseBox cache
113+
.fusebox/
114+
115+
# DynamoDB Local files
116+
.dynamodb/
117+
118+
# Firebase cache directory
119+
.firebase/
120+
121+
# TernJS port file
122+
.tern-port
123+
124+
# Stores VSCode versions used for testing VSCode extensions
125+
.vscode-test
126+
127+
# yarn v3
128+
.pnp.*
129+
.yarn/*
130+
!.yarn/patches
131+
!.yarn/plugins
132+
!.yarn/releases
133+
!.yarn/sdks
134+
!.yarn/versions
135+
136+
# Vite logs files
137+
vite.config.js.timestamp-*
138+
vite.config.ts.timestamp-*

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GitHub Action that returns unity version in specific folder.
88

99
Path to Unity project. Used to find Unity version. Default `${{ github.workspace }}`.
1010

11-
## Outpust
11+
## Outputs
1212

1313
### `unity-version`
1414

@@ -22,7 +22,7 @@ Unity version changeset. Also setted env UNITY_VERSION_CHANGESET
2222

2323
```yaml
2424
- name: Checkout project
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626

2727
- name: Get Unity version
2828
id: unity-version

action.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
name: Get Unity Version
2-
description: Returns Unity project version based on project path
2+
description: Detects Unity version (and changeset) from ProjectSettings/ProjectVersion.txt
3+
author: Appegy
4+
5+
branding:
6+
icon: download
7+
color: gray-dark
8+
39
inputs:
410
project-path:
5-
description: Path to Unity project. Used to find Unity version
11+
description: Path to Unity project root (where ProjectSettings/ exists). Defaults to repository workspace.
612
required: false
7-
default: ${{ github.workspace }}
13+
default: "."
14+
815
outputs:
916
unity-version:
10-
description: Unity version. Also setted env UNITY_VERSION
17+
description: Unity version (also exported as UNITY_VERSION env var).
1118
unity-version-changeset:
12-
description: Unity version changeset. Also setted env UNITY_VERSION_CHANGESET
19+
description: Unity changeset (also exported as UNITY_VERSION_CHANGESET env var).
20+
1321
runs:
14-
using: node12
15-
main: src/setup.js
16-
branding:
17-
icon: download
18-
color: gray-dark
22+
using: node24
23+
main: dist/index.js

0 commit comments

Comments
 (0)