merge main and fix no-abbreviation eslint error

pull/164/head
Aaron Trudeau 2022-03-25 14:00:00 -04:00
commit 7338fb9975
No known key found for this signature in database
GPG Key ID: D6874B046ABF9536
5 changed files with 43 additions and 23 deletions

View File

@ -13,7 +13,7 @@ jobs:
name: Tests name: Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 12.x node-version: 12.x
@ -41,14 +41,14 @@ jobs:
# Checkout # # Checkout #
########################### ###########################
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
lfs: true lfs: true
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }} key: Library-${{ matrix.projectPath }}
@ -82,14 +82,14 @@ jobs:
########################### ###########################
# Checkout # # Checkout #
########################### ###########################
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
lfs: true lfs: true
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v1.1.0 - uses: actions/cache@v3
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
@ -129,14 +129,14 @@ jobs:
########################### ###########################
# Checkout # # Checkout #
########################### ###########################
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
lfs: true lfs: true
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v1.1.0 - uses: actions/cache@v3
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
@ -176,14 +176,14 @@ jobs:
########################### ###########################
# Checkout # # Checkout #
########################### ###########################
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
lfs: true lfs: true
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v1.1.0 - uses: actions/cache@v3
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
@ -223,14 +223,14 @@ jobs:
########################### ###########################
# Checkout # # Checkout #
########################### ###########################
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
lfs: true lfs: true
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v1.1.0 - uses: actions/cache@v3
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}

22
dist/index.js generated vendored
View File

@ -44,6 +44,7 @@ function run() {
const { dockerfile, workspace, actionFolder } = model_1.Action; const { dockerfile, workspace, actionFolder } = model_1.Action;
const { unityVersion, customImage, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, checkName, packageMode, packageName, } = model_1.Input.getFromUser(); const { unityVersion, customImage, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, checkName, packageMode, packageName, } = model_1.Input.getFromUser();
const baseImage = new model_1.ImageTag({ version: unityVersion, customImage }); const baseImage = new model_1.ImageTag({ version: unityVersion, customImage });
const runnerTemporaryPath = process.env.RUNNER_TEMP;
try { try {
// Build docker image // Build docker image
const actionImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage }); const actionImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });
@ -61,6 +62,7 @@ function run() {
packageName, packageName,
gitPrivateToken, gitPrivateToken,
githubToken, githubToken,
runnerTemporaryPath,
}); });
} }
finally { finally {
@ -152,15 +154,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const fs_1 = __nccwpck_require__(7147);
const image_tag_1 = __importDefault(__nccwpck_require__(7648)); const image_tag_1 = __importDefault(__nccwpck_require__(7648));
const exec_1 = __nccwpck_require__(1514); const exec_1 = __nccwpck_require__(1514);
const path_1 = __importDefault(__nccwpck_require__(1017));
const Docker = { const Docker = {
build(buildParameters, silent = false) { build(buildParameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const { path, dockerfile, baseImage } = buildParameters; const { path: buildPath, dockerfile, baseImage } = buildParameters;
const { version } = baseImage; const { version } = baseImage;
const tag = new image_tag_1.default({ version }); const tag = new image_tag_1.default({ version });
const command = `docker build ${path} \ const command = `docker build ${buildPath} \
--file ${dockerfile} \ --file ${dockerfile} \
--build-arg IMAGE=${baseImage} \ --build-arg IMAGE=${baseImage} \
--tag ${tag}`; --tag ${tag}`;
@ -170,7 +174,13 @@ const Docker = {
}, },
run(image, parameters, silent = false) { run(image, parameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const { unityVersion, workspace, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, packageMode, packageName, gitPrivateToken, githubToken, } = parameters; const { unityVersion, workspace, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, packageMode, packageName, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
if (!(0, fs_1.existsSync)(githubHome))
(0, fs_1.mkdirSync)(githubHome);
const githubWorkflow = path_1.default.join(runnerTemporaryPath, '_github_workflow');
if (!(0, fs_1.existsSync)(githubWorkflow))
(0, fs_1.mkdirSync)(githubWorkflow);
const command = `docker run \ const command = `docker run \
--workdir /github/workspace \ --workdir /github/workspace \
--rm \ --rm \
@ -204,9 +214,9 @@ const Docker = {
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \ --env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \ ${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \ --volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "/home/runner/work/_temp/_github_home":"/root" \ --volume "${githubHome}":"/root:z" \
--volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" \ --volume "${githubWorkflow}":"/github/workflow:z" \
--volume "${workspace}":"/github/workspace" \ --volume "${workspace}":"/github/workspace:z" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \ ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \ ${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${useHostNetwork ? '--net=host' : ''} \ ${useHostNetwork ? '--net=host' : ''} \

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -22,6 +22,7 @@ async function run() {
packageName, packageName,
} = Input.getFromUser(); } = Input.getFromUser();
const baseImage = new ImageTag({ version: unityVersion, customImage }); const baseImage = new ImageTag({ version: unityVersion, customImage });
const runnerTemporaryPath = process.env.RUNNER_TEMP;
try { try {
// Build docker image // Build docker image
@ -41,6 +42,7 @@ async function run() {
packageName, packageName,
gitPrivateToken, gitPrivateToken,
githubToken, githubToken,
runnerTemporaryPath,
}); });
} finally { } finally {
// Set output // Set output

View File

@ -1,13 +1,15 @@
import { existsSync, mkdirSync } from 'fs';
import ImageTag from './image-tag'; import ImageTag from './image-tag';
import { exec } from '@actions/exec'; import { exec } from '@actions/exec';
import path from 'path';
const Docker = { const Docker = {
async build(buildParameters, silent = false) { async build(buildParameters, silent = false) {
const { path, dockerfile, baseImage } = buildParameters; const { path: buildPath, dockerfile, baseImage } = buildParameters;
const { version } = baseImage; const { version } = baseImage;
const tag = new ImageTag({ version }); const tag = new ImageTag({ version });
const command = `docker build ${path} \ const command = `docker build ${buildPath} \
--file ${dockerfile} \ --file ${dockerfile} \
--build-arg IMAGE=${baseImage} \ --build-arg IMAGE=${baseImage} \
--tag ${tag}`; --tag ${tag}`;
@ -31,8 +33,14 @@ const Docker = {
packageName, packageName,
gitPrivateToken, gitPrivateToken,
githubToken, githubToken,
runnerTemporaryPath,
} = parameters; } = parameters;
const githubHome = path.join(runnerTemporaryPath, '_github_home');
if (!existsSync(githubHome)) mkdirSync(githubHome);
const githubWorkflow = path.join(runnerTemporaryPath, '_github_workflow');
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
const command = `docker run \ const command = `docker run \
--workdir /github/workspace \ --workdir /github/workspace \
--rm \ --rm \
@ -66,9 +74,9 @@ const Docker = {
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \ --env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \ ${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \ --volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "/home/runner/work/_temp/_github_home":"/root" \ --volume "${githubHome}":"/root:z" \
--volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" \ --volume "${githubWorkflow}":"/github/workflow:z" \
--volume "${workspace}":"/github/workspace" \ --volume "${workspace}":"/github/workspace:z" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \ ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \ ${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${useHostNetwork ? '--net=host' : ''} \ ${useHostNetwork ? '--net=host' : ''} \