Compare commits

..

24 Commits

Author SHA1 Message Date
peaceiris
31256664b6 chore(release): 3.7.1
Some checks failed
Release / release (push) Has been cancelled
2020-10-14 18:19:11 +09:00
peaceiris
e90f765da6 chore(release): Add build assets 2020-10-14 18:19:10 +09:00
Shohei Ueda
725f7db867 fix: copyAssets (#512)
* deps: Add shelljs @types/shelljs
* fix: copyAssets

use shelljs.cp instead of actions/core/io/cp (io.cp)

- https://github.com/shelljs/shelljs
2020-10-14 18:13:17 +09:00
Shohei Ueda
46b269eb77 docs: update title position 2020-10-13 18:01:23 +09:00
Shohei Ueda
572a9b5eb9 ci: allow dependency-type production (#518) 2020-10-13 09:22:01 +09:00
Shohei Ueda
d81433ecbd deps: update (#517) 2020-10-12 15:21:45 +09:00
dependabot[bot]
a284cb02e9 deps: bump jest from 26.5.2 to 26.5.3 (#515)
Bumps [jest](https://github.com/facebook/jest) from 26.5.2 to 26.5.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v26.5.2...v26.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 14:40:33 +09:00
Shohei Ueda
4682881fa3 docs: update exclude_assets 2020-10-12 14:39:56 +09:00
dependabot[bot]
9765b50692 deps: bump jest-circus from 26.5.2 to 26.5.3 (#516)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.5.2 to 26.5.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v26.5.3/packages/jest-circus)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 12:05:23 +09:00
Shohei Ueda
772c200ac1 chore: add .prettierignore 2020-10-11 17:05:06 +09:00
Shohei Ueda
25e5ffa147 feat: Add link to README in log 2020-10-11 11:46:29 +09:00
dependabot[bot]
144799313d deps: bump @types/node from 12.12.66 to 12.12.67 (#511)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.66 to 12.12.67.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-11 09:57:50 +09:00
Shohei Ueda
87e03f1be4 deps: bump node from 12.18.4 to 12.19.0 (#510) 2020-10-11 09:50:33 +09:00
peaceiris
c77e4d0f87 docs: add notes about keep_files
Note that users who are using a Static Site Generator do not need this option in most cases. Please reconsider your project structure and building scripts, or use a built-in feature of a Static Site Generator before you enable this flag.

- [Static Files | Hugo](https://gohugo.io/content-management/static-files/)
- [Using the Static Folder | Gatsby](https://www.gatsbyjs.com/docs/static-folder/)

Related issues:

- #507
- #509
2020-10-11 09:42:17 +09:00
dependabot[bot]
5c575e8b27 deps: bump @types/node from 12.12.64 to 12.12.66 (#508)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.64 to 12.12.66.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-10 01:42:54 +09:00
Shohei Ueda
1a9f7eb481 docs: remove link to #349 2020-10-07 21:43:01 +09:00
Shohei Ueda
c6c5feba5e docs: update Swift Publish
- enhance cache
- pin version to 0.7.0
2020-10-07 14:35:05 +09:00
Shohei Ueda
edd5ff366e docs: update Flutter Web
use GITHUB_PATH instead of add-path
2020-10-07 13:30:37 +09:00
Shohei Ueda
f15a311467 docs: update Swift Publish 2020-10-07 13:28:23 +09:00
dependabot[bot]
274c177da0 deps: bump jest-circus from 26.5.1 to 26.5.2 (#505)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.5.1 to 26.5.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v26.5.2/packages/jest-circus)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-07 11:26:18 +09:00
dependabot[bot]
24f34b2d74 deps: bump jest from 26.5.0 to 26.5.2 (#504)
Bumps [jest](https://github.com/facebook/jest) from 26.5.0 to 26.5.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v26.5.0...v26.5.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-07 11:15:47 +09:00
dependabot[bot]
a60f4671fe deps: bump @types/node from 12.12.63 to 12.12.64 (#506)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.63 to 12.12.64.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-07 11:14:49 +09:00
peaceiris
b3747cde80 docs: pin version to v3 2020-10-07 08:10:13 +09:00
peaceiris
04aa727212 chore(release): Remove build assets [skip ci] 2020-10-07 01:58:40 +09:00
11 changed files with 1311 additions and 2208 deletions

View File

@@ -8,11 +8,8 @@ updates:
timezone: Japan
labels:
- dependencies
ignore:
- dependency-name: "@types/node"
versions:
- ">= 13.a, < 14"
- ">= 14.a, < 15"
allow:
- dependency-type: "production"
commit-message:
prefix: deps

2
.nvmrc
View File

@@ -1 +1 @@
12.18.4
12.19.0

2
.prettierignore Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
lib/

View File

@@ -2,6 +2,50 @@
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.7.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0...v3.7.1) (2020-10-14)
### chore
* add .prettierignore ([772c200](https://github.com/peaceiris/actions-gh-pages/commit/772c200ac146a7e8d63c227a919456f8e0b4693f))
### ci
* allow dependency-type production (#518) ([572a9b5](https://github.com/peaceiris/actions-gh-pages/commit/572a9b5eb96036fc7a15f7edc15612d6889f9cfa)), closes [#518](https://github.com/peaceiris/actions-gh-pages/issues/518)
### deps
* bump @types/node from 12.12.63 to 12.12.64 (#506) ([a60f467](https://github.com/peaceiris/actions-gh-pages/commit/a60f4671feb4a666aab43d6ac5a3783dc4657a43)), closes [#506](https://github.com/peaceiris/actions-gh-pages/issues/506)
* bump @types/node from 12.12.64 to 12.12.66 (#508) ([5c575e8](https://github.com/peaceiris/actions-gh-pages/commit/5c575e8b276eea8921774c99a7b83c0d66cea90a)), closes [#508](https://github.com/peaceiris/actions-gh-pages/issues/508)
* bump @types/node from 12.12.66 to 12.12.67 (#511) ([1447993](https://github.com/peaceiris/actions-gh-pages/commit/144799313d4ad48903ce4729920e3d2f1429bbeb)), closes [#511](https://github.com/peaceiris/actions-gh-pages/issues/511)
* bump jest from 26.5.0 to 26.5.2 (#504) ([24f34b2](https://github.com/peaceiris/actions-gh-pages/commit/24f34b2d740cd79924d8a98bb8f26576309eeced)), closes [#504](https://github.com/peaceiris/actions-gh-pages/issues/504)
* bump jest from 26.5.2 to 26.5.3 (#515) ([a284cb0](https://github.com/peaceiris/actions-gh-pages/commit/a284cb02e9b796754ca6b5c8471b228ec8c6958e)), closes [#515](https://github.com/peaceiris/actions-gh-pages/issues/515)
* bump jest-circus from 26.5.1 to 26.5.2 (#505) ([274c177](https://github.com/peaceiris/actions-gh-pages/commit/274c177da0a2ff2cfe592e6b36c355f8bc062be5)), closes [#505](https://github.com/peaceiris/actions-gh-pages/issues/505)
* bump jest-circus from 26.5.2 to 26.5.3 (#516) ([9765b50](https://github.com/peaceiris/actions-gh-pages/commit/9765b50692abbd7b95c1c097da071f5a9c98804d)), closes [#516](https://github.com/peaceiris/actions-gh-pages/issues/516)
* bump node from 12.18.4 to 12.19.0 (#510) ([87e03f1](https://github.com/peaceiris/actions-gh-pages/commit/87e03f1be4c6673e544b6a89259729c5c646cdf6)), closes [#510](https://github.com/peaceiris/actions-gh-pages/issues/510)
* update (#517) ([d81433e](https://github.com/peaceiris/actions-gh-pages/commit/d81433ecbd529e53bb1201223120e2febf24b310)), closes [#517](https://github.com/peaceiris/actions-gh-pages/issues/517)
### docs
* add notes about keep_files ([c77e4d0](https://github.com/peaceiris/actions-gh-pages/commit/c77e4d0f87024d01904cc067c1a8b8affd80c1f7)), closes [#507](https://github.com/peaceiris/actions-gh-pages/issues/507) [#509](https://github.com/peaceiris/actions-gh-pages/issues/509)
* pin version to v3 ([b3747cd](https://github.com/peaceiris/actions-gh-pages/commit/b3747cde802bb259e2c13135ae1f36d309bd3808))
* remove link to #349 ([1a9f7eb](https://github.com/peaceiris/actions-gh-pages/commit/1a9f7eb4817f70390ed147b00fdf4b7284cd913d)), closes [#349](https://github.com/peaceiris/actions-gh-pages/issues/349)
* update exclude_assets ([4682881](https://github.com/peaceiris/actions-gh-pages/commit/4682881fa3a4b9f5a25027d6bf1b47f6d6fda5e9))
* update Flutter Web ([edd5ff3](https://github.com/peaceiris/actions-gh-pages/commit/edd5ff366e489149e15c36cfe923b1d71953b7a7))
* update Swift Publish ([c6c5feb](https://github.com/peaceiris/actions-gh-pages/commit/c6c5feba5e7cdf1e9227296b38c6ab27a6372304))
* update Swift Publish ([f15a311](https://github.com/peaceiris/actions-gh-pages/commit/f15a3114676f95a60146c8270e93a3ddd2c03086))
* update title position ([46b269e](https://github.com/peaceiris/actions-gh-pages/commit/46b269eb77e5fe6f2fc9c9cc531541227dfeca22))
### feat
* Add link to README in log ([25e5ffa](https://github.com/peaceiris/actions-gh-pages/commit/25e5ffa1476a0017af4dfa0feb054ac18ccd1797))
### fix
* copyAssets (#512) ([725f7db](https://github.com/peaceiris/actions-gh-pages/commit/725f7db867bb4bb443f5d8bdffb18297aab5e5a3)), closes [#512](https://github.com/peaceiris/actions-gh-pages/issues/512)
# [3.7.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-8...v3.7.0) (2020-10-06)

View File

@@ -1,3 +1,7 @@
## GitHub Actions for GitHub Pages
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
[![license](https://img.shields.io/github/license/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/blob/main/LICENSE)
[![release](https://img.shields.io/github/release/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases/latest)
[![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases)
@@ -5,12 +9,6 @@
![Code Scanning](https://github.com/peaceiris/actions-gh-pages/workflows/Code%20Scanning/badge.svg?event=push)
[![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages)
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
## GitHub Actions for GitHub Pages
This is a **GitHub Action** to deploy your static files to **GitHub Pages**.
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, mdBook, Next, Nuxt, and so on.)
@@ -18,7 +16,6 @@ This deploy action can be combined simply and freely with [Static Site Generator
The next example step will deploy `./public` directory to the remote `gh-pages` branch.
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
@@ -41,9 +38,6 @@ Notes: Actually, the `GITHUB_TOKEN` works for deploying to GitHub Pages but it h
For the first deployment, we need to select the `gh-pages` branch or another branch on the repository settings tab.
See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
And you may need to push manually for the first deployment on a private repository.
See [Issue #349](https://github.com/peaceiris/actions-gh-pages/issues/349)
### Supported Platforms
All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
@@ -236,7 +230,7 @@ A destination subdirectory on a publishing branch. The default is empty.
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: subdir
@@ -253,7 +247,7 @@ Values should be split with a comma.
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
exclude_assets: '.github,exclude-file1,exclude-file2'
@@ -263,9 +257,11 @@ Set `exclude_assets` to empty for including the `.github` directory to deploymen
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # Recommended for this usage
# personal_token: ${{ secrets.PERSONAL_TOKEN }} # An alternative
# github_token: ${{ secrets.GITHUB_TOKEN }} # This does not work for this usage
exclude_assets: ''
```
@@ -273,7 +269,7 @@ The `exclude_assets` option supports glob patterns.
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
exclude_assets: '.github,exclude-file.txt,exclude-dir/**.txt'
@@ -335,6 +331,11 @@ For example:
By default, existing files in the publish branch are removed before adding the ones from publish dir. If you want the action to add new files but leave existing ones untouched, set the optional parameter `keep_files` to `true`.
Note that users who are using a Static Site Generator do not need this option in most cases. Please reconsider your project structure and building scripts, or use a built-in feature of a Static Site Generator before you enable this flag.
- [Static Files | Hugo](https://gohugo.io/content-management/static-files/)
- [Using the Static Folder | Gatsby](https://www.gatsbyjs.com/docs/static-folder/)
For example:
```yaml
@@ -958,7 +959,7 @@ jobs:
- name: Setup Flutter
run: |
git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter
echo "::add-path::${GITHUB_WORKSPACE}/_flutter/bin"
echo "${GITHUB_WORKSPACE}/_flutter/bin" >> ${GITHUB_PATH}
- name: Install
run: |
@@ -1067,17 +1068,29 @@ on:
jobs:
deploy:
runs-on: ubuntu-18.04
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/Publish_build
.build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Setup JohnSundell/Publish
run: |
cd ${HOME}
git clone --depth=1 https://github.com/JohnSundell/Publish.git
cd ./Publish
export PUBLISH_VERSION="0.7.0"
git clone https://github.com/JohnSundell/Publish.git
cd ./Publish && git checkout ${PUBLISH_VERSION}
mv ~/Publish_build .build || true
swift build -c release
echo "::add-path::${HOME}/Publish/.build/release"
cp -r .build ~/Publish_build || true
echo "${HOME}/Publish/.build/release" >> ${GITHUB_PATH}
- run: publish-cli generate

File diff suppressed because one or more lines are too long

3359
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.7.0",
"version": "3.7.1",
"description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js",
"engines": {
@@ -58,22 +58,24 @@
"@actions/exec": "^1.0.4",
"@actions/github": "^4.0.0",
"@actions/glob": "^0.1.0",
"@actions/io": "^1.0.2"
"@actions/io": "^1.0.2",
"@types/shelljs": "^0.8.8",
"shelljs": "^0.8.4"
},
"devDependencies": {
"@types/jest": "^26.0.14",
"@types/js-yaml": "^3.12.5",
"@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"@vercel/ncc": "^0.24.1",
"eslint": "^6.8.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.3.0",
"jest": "^26.5.0",
"jest-circus": "^26.5.1",
"jest": "^26.5.3",
"jest-circus": "^26.5.3",
"js-yaml": "^3.14.0",
"lint-staged": "^10.4.0",
"prettier": "2.1.2",

View File

@@ -6,6 +6,7 @@ import path from 'path';
import fs from 'fs';
import {Inputs, CmdResult} from './interfaces';
import {createDir} from './utils';
import {cp} from 'shelljs';
export async function createBranchForce(branch: string): Promise<void> {
await exec.exec('git', ['init']);
@@ -37,24 +38,21 @@ export async function copyAssets(
excludeAssets: string
): Promise<void> {
core.info(`[INFO] prepare publishing assets`);
const copyOpts = {recursive: true, force: true};
const files = fs.readdirSync(publishDir);
core.debug(`${files}`);
for await (const file of files) {
if (file === '.git') {
core.info(`[INFO] skip ${file}`);
continue;
}
const filePublishPath = path.join(publishDir, file);
const fileDestPath = path.join(destDir, file);
const destPath = path.dirname(fileDestPath);
if (fs.existsSync(destPath) === false) {
await createDir(destPath);
}
core.info(`[INFO] copy ${file}`);
await io.cp(filePublishPath, fileDestPath, copyOpts);
if (fs.existsSync(destDir) === false) {
core.info(`[INFO] create ${destDir}`);
await createDir(destDir);
}
const dotGitPath = path.join(publishDir, '.git');
if (fs.existsSync(dotGitPath)) {
core.info(`[INFO] delete .git`);
io.rmRF(dotGitPath);
}
core.info(`[INFO] copy ${publishDir} to ${destDir}`);
cp('-RfL', [`${publishDir}/*`], destDir);
await deleteExcludedAssets(destDir, excludeAssets);
return;

View File

@@ -10,6 +10,8 @@ import {getWorkDirName, addNoJekyll, addCNAME, skipOnFork} from './utils';
export async function run(): Promise<void> {
try {
core.info('[INFO] Usage https://github.com/peaceiris/actions-gh-pages#readme');
const inps: Inputs = getInputs();
core.startGroup('Dump inputs');
showInputs(inps);

View File

@@ -4,7 +4,9 @@ import * as github from '@actions/github';
import * as io from '@actions/io';
import path from 'path';
import fs from 'fs';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cpSpawnSync = require('child_process').spawnSync;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cpexec = require('child_process').execFileSync;
import {Inputs} from './interfaces';
import {getHomeDir} from './utils';