Compare commits

...

9 Commits

Author SHA1 Message Date
peaceiris
8a36f3edfc chore(release): 3.6.4
Some checks failed
Release / release (push) Has been cancelled
2020-07-18 13:02:36 +09:00
peaceiris
220a06da5e chore(release): Add build assets 2020-07-18 13:02:34 +09:00
favonia
e193524bff feat: Allow absolute path for publish_dir (#400)
Close #242
2020-07-18 12:55:50 +09:00
dependabot[bot]
7e92312ae4 deps: bump typescript from 3.9.6 to 3.9.7 (#399)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.6 to 3.9.7.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.6...v3.9.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-17 11:19:32 +09:00
Shohei Ueda
3d656402e5 feat: enhance error message (#398) 2020-07-15 02:04:43 +09:00
Shohei Ueda
6901b8e8fc docs: change default branch from master to main (#397) 2020-07-15 01:41:09 +09:00
Shohei Ueda
932df18147 chore: change default branch from master to main (#396) 2020-07-14 12:45:04 +09:00
dependabot[bot]
c935046a93 deps: bump standard-version from 8.0.1 to 8.0.2 (#395)
Bumps [standard-version](https://github.com/conventional-changelog/standard-version) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/conventional-changelog/standard-version/releases)
- [Changelog](https://github.com/conventional-changelog/standard-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/standard-version/compare/v8.0.1...v8.0.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-14 11:18:14 +09:00
peaceiris
ed8dfeaf86 chore(release): Remove build assets [skip ci] 2020-07-14 09:06:36 +09:00
11 changed files with 65 additions and 35 deletions

View File

@@ -3,7 +3,7 @@ name: "Code Scanning"
on: on:
push: push:
branches: branches:
- master - main
pull_request: pull_request:
jobs: jobs:

View File

@@ -3,7 +3,7 @@ name: 'Dev Image CI'
on: on:
push: push:
branches: branches:
- master - main
paths: paths:
- '.github/workflows/dev-image.yml' - '.github/workflows/dev-image.yml'
- '.dockerignore' - '.dockerignore'
@@ -40,4 +40,4 @@ jobs:
- run: make cirun cmd="npm ci" - run: make cirun cmd="npm ci"
- run: make ciall - run: make ciall
- run: make push - run: make push
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/main'

View File

@@ -3,7 +3,7 @@ name: 'Test'
on: on:
push: push:
branches: branches:
- master - main
paths-ignore: paths-ignore:
- '*.md' - '*.md'
pull_request: pull_request:
@@ -72,26 +72,26 @@ jobs:
run: npm run build run: npm run build
- name: Remove lint-staged husky - name: Remove lint-staged husky
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/main'
run: | run: |
npm uninstall lint-staged husky npm uninstall lint-staged husky
git checkout package-lock.json package.json git checkout package-lock.json package.json
- name: Setup mdBook - name: Setup mdBook
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-mdbook@v1.1.12 uses: peaceiris/actions-mdbook@v1.1.12
with: with:
mdbook-version: '0.3.7' mdbook-version: '0.3.7'
- name: Build site - name: Build site
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/main'
working-directory: ./test_projects/mdbook working-directory: ./test_projects/mdbook
run: mdbook build run: mdbook build
- name: Deploy - name: Deploy
if: | if: |
startsWith(matrix.os, 'ubuntu-18.04') && startsWith(matrix.os, 'ubuntu-18.04') &&
github.ref == 'refs/heads/master' github.ref == 'refs/heads/main'
uses: ./ uses: ./
with: with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -110,7 +110,7 @@ jobs:
- name: Deploy - name: Deploy
if: | if: |
startsWith(matrix.os, 'ubuntu-16.04') && startsWith(matrix.os, 'ubuntu-16.04') &&
github.ref == 'refs/heads/master' github.ref == 'refs/heads/main'
uses: ./ uses: ./
with: with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -128,7 +128,7 @@ jobs:
- name: Deploy - name: Deploy
if: | if: |
startsWith(matrix.os, 'macos') && startsWith(matrix.os, 'macos') &&
github.ref == 'refs/heads/master' github.ref == 'refs/heads/main'
uses: ./ uses: ./
with: with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -147,7 +147,7 @@ jobs:
- name: Deploy - name: Deploy
if: | if: |
startsWith(matrix.os, 'windows') && startsWith(matrix.os, 'windows') &&
github.ref == 'refs/heads/master' github.ref == 'refs/heads/main'
uses: ./ uses: ./
with: with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -166,7 +166,7 @@ jobs:
- name: Deploy - name: Deploy
if: | if: |
startsWith(matrix.os, 'ubuntu-20.04') && startsWith(matrix.os, 'ubuntu-20.04') &&
github.ref == 'refs/heads/master' github.ref == 'refs/heads/main'
uses: ./ uses: ./
with: with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}

View File

@@ -2,6 +2,29 @@
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. 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.6.4](https://github.com/peaceiris/actions-gh-pages/compare/v3.6.3...v3.6.4) (2020-07-18)
### chore
* change default branch from master to main (#396) ([932df18](https://github.com/peaceiris/actions-gh-pages/commit/932df18147b59ce4a998b4caabfcc50f1889c827)), closes [#396](https://github.com/peaceiris/actions-gh-pages/issues/396)
### deps
* bump standard-version from 8.0.1 to 8.0.2 (#395) ([c935046](https://github.com/peaceiris/actions-gh-pages/commit/c935046a93788ca4ea55bb13f438ae77a54a9197)), closes [#395](https://github.com/peaceiris/actions-gh-pages/issues/395)
* bump typescript from 3.9.6 to 3.9.7 (#399) ([7e92312](https://github.com/peaceiris/actions-gh-pages/commit/7e92312ae46d6a7ad1c55a6ce3d98c66ae1ddda3)), closes [#399](https://github.com/peaceiris/actions-gh-pages/issues/399)
### docs
* change default branch from master to main (#397) ([6901b8e](https://github.com/peaceiris/actions-gh-pages/commit/6901b8e8fcec69a339c4a622b85ec3f66e78f90a)), closes [#397](https://github.com/peaceiris/actions-gh-pages/issues/397)
### feat
* Allow absolute path for publish_dir (#400) ([e193524](https://github.com/peaceiris/actions-gh-pages/commit/e193524bff3509becae7e3ced3114176cc70a5dd)), closes [#400](https://github.com/peaceiris/actions-gh-pages/issues/400) [#242](https://github.com/peaceiris/actions-gh-pages/issues/242)
* enhance error message (#398) ([3d65640](https://github.com/peaceiris/actions-gh-pages/commit/3d656402e52a96a0c027e4ad98f3ce06da7f8c1b)), closes [#398](https://github.com/peaceiris/actions-gh-pages/issues/398)
## [3.6.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.6.2...v3.6.3) (2020-07-14) ## [3.6.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.6.2...v3.6.3) (2020-07-14)

View File

@@ -1,7 +1,7 @@
[![license](https://img.shields.io/github/license/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE) [![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) [![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) [![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases)
![Test](https://github.com/peaceiris/actions-gh-pages/workflows/Test/badge.svg?branch=master&event=push) ![Test](https://github.com/peaceiris/actions-gh-pages/workflows/Test/badge.svg?branch=main&event=push)
[![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages) [![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"> <img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
@@ -1081,7 +1081,7 @@ jobs:
- [MIT License - peaceiris/actions-gh-pages] - [MIT License - peaceiris/actions-gh-pages]
[MIT License - peaceiris/actions-gh-pages]: https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE [MIT License - peaceiris/actions-gh-pages]: https://github.com/peaceiris/actions-gh-pages/blob/main/LICENSE

File diff suppressed because one or more lines are too long

14
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "actions-github-pages", "name": "actions-github-pages",
"version": "3.6.3", "version": "3.6.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -8388,9 +8388,9 @@
"dev": true "dev": true
}, },
"standard-version": { "standard-version": {
"version": "8.0.1", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.1.tgz", "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.2.tgz",
"integrity": "sha512-FLZdjvL2tBdwlctfQeyBf4+dX+SFljwdWfUA0F3wPiU9Rn0+FSuD3I0WXuzC1RmcaWwU5WL3EyV4Aanejc8Pqg==", "integrity": "sha512-L8X9KFq2SmVmaeZgUmWHFJMOsEWpjgFAwqic6yIIoveM1kdw1vH4Io03WWxUDjypjGqGU6qUtcJoR8UvOv5w3g==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
@@ -8935,9 +8935,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "3.9.6", "version": "3.9.7",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
"integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "actions-github-pages", "name": "actions-github-pages",
"version": "3.6.3", "version": "3.6.4",
"description": "GitHub Actions for GitHub Pages", "description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js", "main": "lib/index.js",
"engines": { "engines": {
@@ -76,8 +76,8 @@
"js-yaml": "^3.14.0", "js-yaml": "^3.14.0",
"lint-staged": "^10.2.11", "lint-staged": "^10.2.11",
"prettier": "2.0.5", "prettier": "2.0.5",
"standard-version": "^8.0.1", "standard-version": "^8.0.2",
"ts-jest": "^25.5.1", "ts-jest": "^25.5.1",
"typescript": "^3.9.6" "typescript": "^3.9.7"
} }
} }

View File

@@ -3,9 +3,11 @@
# fail on unset variables and command errors # fail on unset variables and command errors
set -eu -o pipefail # -x: is for debugging set -eu -o pipefail # -x: is for debugging
DEFAULT_BRANCH="main"
CURRENT_BRANCH="$(git branch --show-current)" CURRENT_BRANCH="$(git branch --show-current)"
if [ "${CURRENT_BRANCH}" != "master" ]; then if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
echo "$0: Current branch ${CURRENT_BRANCH} is not master, continue? (y/n)" echo "$0: Current branch ${CURRENT_BRANCH} is not ${DEFAULT_BRANCH}, continue? (y/n)"
read -r res read -r res
if [ "${res}" = "n" ]; then if [ "${res}" = "n" ]; then
echo "$0: Stop script" echo "$0: Stop script"
@@ -14,7 +16,7 @@ if [ "${CURRENT_BRANCH}" != "master" ]; then
fi fi
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor" PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
if [ "${CURRENT_BRANCH}" != "master" ]; then if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}" RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
else else
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major" RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
@@ -37,10 +39,10 @@ if [ "${res}" = "n" ]; then
fi fi
git fetch origin git fetch origin
if [ "${CURRENT_BRANCH}" != "master" ]; then if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
git pull origin "${CURRENT_BRANCH}" git pull origin "${CURRENT_BRANCH}"
else else
git pull origin master git pull origin ${DEFAULT_BRANCH}
git tag -d v3 || true git tag -d v3 || true
git pull origin --tags git pull origin --tags
fi fi
@@ -58,10 +60,10 @@ git rm ./lib/index.js
rm -rf ./lib rm -rf ./lib
git commit -m "chore(release): Remove build assets [skip ci]" git commit -m "chore(release): Remove build assets [skip ci]"
if [ "${CURRENT_BRANCH}" != "master" ]; then if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
git push origin "${CURRENT_BRANCH}" git push origin "${CURRENT_BRANCH}"
else else
git push origin master git push origin ${DEFAULT_BRANCH}
fi fi
TAG_NAME="v$(jq -r '.version' ./package.json)" TAG_NAME="v$(jq -r '.version' ./package.json)"

View File

@@ -29,7 +29,9 @@ export async function copyAssets(publishDir: string, workDir: string): Promise<v
} }
export async function setRepo(inps: Inputs, remoteURL: string, workDir: string): Promise<void> { export async function setRepo(inps: Inputs, remoteURL: string, workDir: string): Promise<void> {
const publishDir = path.join(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir); const publishDir = path.isAbsolute(inps.PublishDir)
? inps.PublishDir
: path.join(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir);
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`); core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
if (inps.ForceOrphan) { if (inps.ForceOrphan) {

View File

@@ -85,7 +85,10 @@ Use deploy_key or personal_token.
if (eventName === 'push') { if (eventName === 'push') {
isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null; isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null;
if (isProhibitedBranch) { if (isProhibitedBranch) {
throw new Error(`You deploy from ${publishBranch} to ${publishBranch}`); throw new Error(`\
You deploy from ${publishBranch} to ${publishBranch}
This operation is prohibited to protect your contents
`);
} }
} }