From 43f3196fa863f88930f40d039e4f3c3e175a1630 Mon Sep 17 00:00:00 2001 From: shimataro Date: Tue, 21 Jan 2020 23:09:13 +0900 Subject: [PATCH 1/5] * update examples (#84) --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index e745912..6953fea 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,6 @@ steps: name: id_rsa # optional known-hosts: ${{ secrets.KNOWN_HOSTS }} # known_hosts; optional config: ${{ secrets.CONFIG }} # ssh_config; optional -- name: Install packages - run: apt install openssh-client rsync - name: rsync over ssh run: rsync ./foo/ user@remote:bar/ ``` @@ -70,8 +68,6 @@ steps: User user-of-target IdentityFile ~/.ssh/id_rsa-target ProxyCommand ssh -W %h:%p bastion -- name: Install packages - run: apt install openssh-client - name: SCP via port-forwarding run: scp ./foo/ target:bar/ ``` From 410fe0c2fb2b9ee7a12f95518c9133a7720db5f9 Mon Sep 17 00:00:00 2001 From: shimataro Date: Wed, 22 Jan 2020 23:50:32 +0900 Subject: [PATCH 2/5] * add note about key format (#86) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6953fea..799186f 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Useful for SCP, SFTP, and `rsync` over SSH in deployment script. Add your SSH key to your product secrets by clicking `Settings` - `Secrets` - `Add a new secret` beforehand. +**NOTE:** Due to version of OpenSSH on VM, OpenSSH key format (begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work. Please use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`) instead. + ```yaml runs-on: ubuntu-latest steps: From 918fed51a130cddd684a8ee68e1a1cffb42f7016 Mon Sep 17 00:00:00 2001 From: shimataro Date: Thu, 23 Jan 2020 23:20:07 +0900 Subject: [PATCH 3/5] Feature/scripts (#87) * * refactor create-release-branch.sh * * refactor rebuild.sh * * refactor update-dependencies.sh --- scripts/create-release-branch.sh | 22 ++++++++++------------ scripts/rebuild.sh | 2 ++ scripts/update-dependencies.sh | 20 +++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/scripts/create-release-branch.sh b/scripts/create-release-branch.sh index 210c5fc..a736165 100755 --- a/scripts/create-release-branch.sh +++ b/scripts/create-release-branch.sh @@ -3,6 +3,8 @@ # - git; I believe it's already installed. # - sed; GNU sed is preferred. POSIX sed may not work. +set -e + BASE_BRANCH="develop" PACKAGE_NAME="ssh-key-action" @@ -36,14 +38,14 @@ function main() { check_version_format ${VERSION} check_current_branch - run create_branch ${BRANCH} - run update_changelog ${VERSION} - run update_package_version ${VERSION} - run update_dependencies_version - run regenerate_package_lock - run build_package - run commit_changes ${VERSION} - run finish ${VERSION} ${BRANCH} ${TAG} + create_branch ${BRANCH} + update_changelog ${VERSION} + update_package_version ${VERSION} + update_dependencies_version + regenerate_package_lock + build_package + commit_changes ${VERSION} + finish ${VERSION} ${BRANCH} ${TAG} } function usage() { @@ -91,10 +93,6 @@ function check_current_branch() { exit 2 } -function run() { - "$@" || exit 1 -} - function create_branch() { local BRANCH=$1 diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh index fbc39c2..8301938 100755 --- a/scripts/rebuild.sh +++ b/scripts/rebuild.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rm -rf node_modules package-lock.json npm i npm run build diff --git a/scripts/update-dependencies.sh b/scripts/update-dependencies.sh index b859641..7ae8bb8 100755 --- a/scripts/update-dependencies.sh +++ b/scripts/update-dependencies.sh @@ -1,30 +1,32 @@ #!/bin/bash # update dependencies +set -e + DATE=$(date +"%Y%m%d") BRANCH=feature/update-dependencies-${DATE} COLOR_SUCCESS="\e[1;32m" COLOR_RESET="\e[m" # create branch -git checkout develop || exit 1 -git checkout -b ${BRANCH} || exit 1 +git checkout develop +git checkout -b ${BRANCH} # check updates npm ci -npm run check-updates -- -u || exit 1 +npm run check-updates -- -u # re-install packages -rm -rf package-lock.json node_modules || exit 1 -npm i || exit 1 +rm -rf package-lock.json node_modules +npm i # build check -npm run build || exit 1 +npm run build # commit -npm ci --only=production || exit 1 -git add package.json package-lock.json node_modules || exit 1 -git commit -m "update dependencies" || exit 1 +npm ci --only=production +git add package.json package-lock.json node_modules +git commit -m "update dependencies" # finished! echo -e " From ccd2b7e901fa8111f24178f916925cc27fc95007 Mon Sep 17 00:00:00 2001 From: shimataro Date: Sat, 25 Jan 2020 08:10:07 +0900 Subject: [PATCH 4/5] Feature/key notice (#88) * * update key notice * rerun CI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 799186f..6d2ab76 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Useful for SCP, SFTP, and `rsync` over SSH in deployment script. Add your SSH key to your product secrets by clicking `Settings` - `Secrets` - `Add a new secret` beforehand. -**NOTE:** Due to version of OpenSSH on VM, OpenSSH key format (begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work. Please use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`) instead. +**NOTE:** Due to version of OpenSSH on VM, OPENSSH format (key begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work. Please use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`) instead. ```yaml runs-on: ubuntu-latest From 041a5e76735010c45a100e2d0ccf870b3baf0d81 Mon Sep 17 00:00:00 2001 From: shimataro Date: Sat, 25 Jan 2020 08:17:40 +0900 Subject: [PATCH 5/5] * update badges for v1 (#89) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d2ab76..ff00f0f 100644 --- a/README.md +++ b/README.md @@ -82,15 +82,15 @@ The scripts and documentation in this project are released under the [MIT Licens See [CHANGELOG.md](CHANGELOG.md). -[image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg +[image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg?event=push&branch=v1 [link-build]: https://github.com/shimataro/ssh-key-action -[image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg -[image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg -[image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg -[image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg +[image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg?event=push&branch=v1 [link-verify-windows]: https://github.com/shimataro/ssh-key-action +[image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg?event=push&branch=v1 [link-verify-macos]: https://github.com/shimataro/ssh-key-action +[image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg?event=push&branch=v1 [link-verify-ubuntu]: https://github.com/shimataro/ssh-key-action +[image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v1 [link-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action [image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg [link-release]: https://github.com/shimataro/ssh-key-action/releases