Compare commits

..

5 Commits

Author SHA1 Message Date
peaceiris
43687c847a chore(release): 3.1.0
Some checks failed
Release / release (push) Has been cancelled
2020-02-19 22:58:13 +09:00
peaceiris
218e357d06 chore(release): Add build assets 2020-02-19 22:58:12 +09:00
Shohei Ueda
2f5ccc92df fix: Use onetime workdir name (#109)
* chore: Allow to release from not master

* chore(release): 3.0.4-0
* chore(release): 3.0.4-1
2020-02-19 22:56:40 +09:00
Shohei Ueda
195ab8005d deps: Rollback @types/node 13 to 12 (#111) 2020-02-19 12:16:41 +09:00
dependabot-preview[bot]
591c4bdf2e deps: bump @types/node from 13.7.1 to 13.7.2 (#110) 2020-02-19 02:38:01 +00:00
6 changed files with 81 additions and 24 deletions

View File

@@ -2,6 +2,62 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
# [3.1.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3...v3.1.0) (2020-02-19)
### deps
* bump @types/jest from 25.1.1 to 25.1.2 (#93) ([aec195e](https://github.com/peaceiris/actions-gh-pages/commit/aec195ebb4e984f62f48139a5e24aa85ea31e891)), closes [#93](https://github.com/peaceiris/actions-gh-pages/issues/93)
* bump @types/node from 13.7.0 to 13.7.1 (#99) ([0b00dd2](https://github.com/peaceiris/actions-gh-pages/commit/0b00dd2a9f91c1854f4b1cfe68dc30891ebccc9f)), closes [#99](https://github.com/peaceiris/actions-gh-pages/issues/99)
* bump @types/node from 13.7.1 to 13.7.2 (#110) ([591c4bd](https://github.com/peaceiris/actions-gh-pages/commit/591c4bdf2ee1c6aa5f1958c4553902feac06dcfe)), closes [#110](https://github.com/peaceiris/actions-gh-pages/issues/110)
* bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 (#97) ([5d5e933](https://github.com/peaceiris/actions-gh-pages/commit/5d5e9338ccbca63f80f5ee66ba9e9eff14bacb68)), closes [#97](https://github.com/peaceiris/actions-gh-pages/issues/97)
* bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 (#105) ([1c50baa](https://github.com/peaceiris/actions-gh-pages/commit/1c50baa294d259f81459f7a495f8d0d2a50a1b6d)), closes [#105](https://github.com/peaceiris/actions-gh-pages/issues/105)
* bump @typescript-eslint/parser from 2.19.0 to 2.19.2 (#96) ([8b52b41](https://github.com/peaceiris/actions-gh-pages/commit/8b52b41ecb191f50bd5efc9ee2c0266a2d171d14)), closes [#96](https://github.com/peaceiris/actions-gh-pages/issues/96)
* bump @typescript-eslint/parser from 2.19.2 to 2.20.0 (#106) ([73c09c7](https://github.com/peaceiris/actions-gh-pages/commit/73c09c703e63c0b442ffa50624ace10eaa929280)), closes [#106](https://github.com/peaceiris/actions-gh-pages/issues/106)
* bump eslint-plugin-jest from 23.6.0 to 23.7.0 (#95) ([0a1a581](https://github.com/peaceiris/actions-gh-pages/commit/0a1a58196ba5bf48e168475e0ac3898fbd3043e2)), closes [#95](https://github.com/peaceiris/actions-gh-pages/issues/95)
* bump husky from 4.2.1 to 4.2.3 (#102) ([49a6939](https://github.com/peaceiris/actions-gh-pages/commit/49a6939dbb77d7656228cdc3bed6a99d5124a6b2)), closes [#102](https://github.com/peaceiris/actions-gh-pages/issues/102)
* bump node from 12.14.1 to 12.15.0 (#94) ([0e542f9](https://github.com/peaceiris/actions-gh-pages/commit/0e542f9f9231c005e1a6363a33a69fdbde436085)), closes [#94](https://github.com/peaceiris/actions-gh-pages/issues/94)
* Rollback @types/node 13 to 12 (#111) ([195ab80](https://github.com/peaceiris/actions-gh-pages/commit/195ab8005d4af142c40fd8e53a59783b697d75d9)), closes [#111](https://github.com/peaceiris/actions-gh-pages/issues/111)
### docs
* fix ([60c31d2](https://github.com/peaceiris/actions-gh-pages/commit/60c31d23a8a096624a3b9a0955a05ea9941dc140))
* rename author to Maintainer ([4101589](https://github.com/peaceiris/actions-gh-pages/commit/41015898aad0abad9d0760bc576e4748e476d4f9))
* update job name ([752214a](https://github.com/peaceiris/actions-gh-pages/commit/752214aa33756f6e097f908671681a13865a9991))
* update publish_branch for v3 ([a7866b5](https://github.com/peaceiris/actions-gh-pages/commit/a7866b5bd3a121a460c8c39cb1c9d1586db6b231))
* update status of github_token ([1887981](https://github.com/peaceiris/actions-gh-pages/commit/1887981f72e59b54f68febb4fa4786e7e153ef6d))
### fix
* Change final message ([476fa94](https://github.com/peaceiris/actions-gh-pages/commit/476fa94197aea4d3f74e5619ae77ebf966fd5fff))
* Use onetime workdir name (#109) ([2f5ccc9](https://github.com/peaceiris/actions-gh-pages/commit/2f5ccc92dfcf8e85d9d3c19dc842a440380253bf)), closes [#109](https://github.com/peaceiris/actions-gh-pages/issues/109)
### refactor
* fix typo and remove useless function (#107) ([55a68e3](https://github.com/peaceiris/actions-gh-pages/commit/55a68e34ca406d99b5b2a4549d7ade5eeb03d860)), closes [#107](https://github.com/peaceiris/actions-gh-pages/issues/107)
## [3.0.4-1](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.4-0...v3.0.4-1) (2020-02-19)
### deps
* bump @types/node from 13.7.1 to 13.7.2 (#110) ([591c4bd](https://github.com/peaceiris/actions-gh-pages/commit/591c4bdf2ee1c6aa5f1958c4553902feac06dcfe)), closes [#110](https://github.com/peaceiris/actions-gh-pages/issues/110)
* Rollback @types/node 13 to 12 (#111) ([195ab80](https://github.com/peaceiris/actions-gh-pages/commit/195ab8005d4af142c40fd8e53a59783b697d75d9)), closes [#111](https://github.com/peaceiris/actions-gh-pages/issues/111)
### fix
* Add await ([0031179](https://github.com/peaceiris/actions-gh-pages/commit/00311793aa104bf99501373756461475b6752f16))
* convert to string ([cbe4d56](https://github.com/peaceiris/actions-gh-pages/commit/cbe4d56fb8bd50d63919f783483f74c694a3dd9b))
* use onetime workdir name ([0d912a1](https://github.com/peaceiris/actions-gh-pages/commit/0d912a1314ce9d77f29bc0c1fada559223dd5563))
### refactor
* Add info message ([8e6c12a](https://github.com/peaceiris/actions-gh-pages/commit/8e6c12a2b5f973c8736f831398d0fe7c980f1431))
## [3.0.4-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3...v3.0.4-0) (2020-02-18)

View File

@@ -2249,7 +2249,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const exec = __importStar(__webpack_require__(986));
const io = __importStar(__webpack_require__(1));
const get_inputs_1 = __webpack_require__(452);
const set_tokens_1 = __webpack_require__(615);
const git = __importStar(__webpack_require__(496));
@@ -2260,7 +2259,9 @@ function run() {
yield git.setConfig(inps.UserName, inps.UserEmail);
const remoteURL = yield set_tokens_1.setTokens(inps);
core.debug(`[INFO] remoteURL: ${remoteURL}`);
const workDir = yield git.setRepo(inps, remoteURL);
const date = new Date();
const unixTime = date.getTime();
yield git.setRepo(inps, remoteURL, `${unixTime}`);
try {
yield exec.exec('git', ['remote', 'rm', 'origin']);
}
@@ -2273,7 +2274,6 @@ function run() {
yield git.push(inps.PublishBranch, inps.ForceOrphan);
yield git.pushTag(inps.TagName, inps.TagMessage);
core.info('[INFO] Action successfully completed');
io.rmRF(workDir);
return;
}
catch (e) {
@@ -8375,9 +8375,9 @@ function copyAssets(publishDir, workDir) {
});
}
exports.copyAssets = copyAssets;
function setRepo(inps, remoteURL) {
function setRepo(inps, remoteURL, unixTime) {
return __awaiter(this, void 0, void 0, function* () {
const workDir = path_1.default.join(utils_1.getHomeDir(), 'actions_github_pages');
const workDir = path_1.default.join(utils_1.getHomeDir(), `actions_github_pages_${unixTime}`);
const publishDir = path_1.default.join(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir);
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
if (inps.ForceOrphan) {
@@ -8385,7 +8385,7 @@ function setRepo(inps, remoteURL) {
process.chdir(workDir);
yield createBranchForce(inps.PublishBranch);
yield copyAssets(publishDir, workDir);
return workDir;
return;
}
const result = {
exitcode: 0,
@@ -8417,7 +8417,7 @@ function setRepo(inps, remoteURL) {
yield exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
}
yield copyAssets(publishDir, workDir);
return workDir;
return;
}
else {
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
@@ -8430,7 +8430,7 @@ function setRepo(inps, remoteURL) {
process.chdir(workDir);
yield createBranchForce(inps.PublishBranch);
yield copyAssets(publishDir, workDir);
return workDir;
return;
}
});
}

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.0.4-0",
"version": "3.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -756,9 +756,9 @@
"dev": true
},
"@types/node": {
"version": "13.7.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.1.tgz",
"integrity": "sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA=="
"version": "12.12.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.27.tgz",
"integrity": "sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A=="
},
"@types/parse-json": {
"version": "4.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.0.4-0",
"version": "3.1.0",
"description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js",
"engines": {
@@ -57,7 +57,7 @@
},
"devDependencies": {
"@types/jest": "^25.1.2",
"@types/node": "^13.7.1",
"@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.20.0",
"@zeit/ncc": "^0.21.0",

View File

@@ -40,9 +40,10 @@ export async function copyAssets(
export async function setRepo(
inps: Inputs,
remoteURL: string
): Promise<string> {
const workDir = path.join(getHomeDir(), 'actions_github_pages');
remoteURL: string,
unixTime: string
): Promise<void> {
const workDir = path.join(getHomeDir(), `actions_github_pages_${unixTime}`);
const publishDir = path.join(
`${process.env.GITHUB_WORKSPACE}`,
inps.PublishDir
@@ -54,7 +55,7 @@ export async function setRepo(
process.chdir(workDir);
await createBranchForce(inps.PublishBranch);
await copyAssets(publishDir, workDir);
return workDir;
return;
}
const result: CmdResult = {
@@ -92,7 +93,7 @@ export async function setRepo(
}
await copyAssets(publishDir, workDir);
return workDir;
return;
} else {
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
}
@@ -105,7 +106,7 @@ export async function setRepo(
process.chdir(workDir);
await createBranchForce(inps.PublishBranch);
await copyAssets(publishDir, workDir);
return workDir;
return;
}
}

View File

@@ -1,6 +1,5 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as io from '@actions/io';
import {Inputs} from './interfaces';
import {getInputs} from './get-inputs';
import {setTokens} from './set-tokens';
@@ -15,7 +14,9 @@ export async function run(): Promise<void> {
const remoteURL = await setTokens(inps);
core.debug(`[INFO] remoteURL: ${remoteURL}`);
const workDir = await git.setRepo(inps, remoteURL);
const date = new Date();
const unixTime = date.getTime();
await git.setRepo(inps, remoteURL, `${unixTime}`);
try {
await exec.exec('git', ['remote', 'rm', 'origin']);
@@ -32,9 +33,8 @@ export async function run(): Promise<void> {
);
await git.push(inps.PublishBranch, inps.ForceOrphan);
await git.pushTag(inps.TagName, inps.TagMessage);
core.info('[INFO] Action successfully completed');
io.rmRF(workDir);
core.info('[INFO] Action successfully completed');
return;
} catch (e) {