Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* Move `pkg-file` and `autoloads` commands under `generate` subcommand (#142)
* Add option to convert Cask to Eask (#141 and #145)
* Add command to generate GHA workflow (#141 and #146)
* Add commands to support all kind of CI platforms (#150)

## 0.7.x
> Released Sep 08, 2022
Expand Down
36 changes: 36 additions & 0 deletions cmds/generate/workflow/circle-ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['circle-ci [file]'];
exports.desc = 'Generate CircleCI workflow yaml file';
exports.builder = {
file: {
description: 'name of the test file; the default is `config.yml`',
requiresArg: false,
type: 'array',
group: TITLE_CMD_OPTION,
},
};

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'generate/workflow/circle-ci', argv.file);
};

2 changes: 1 addition & 1 deletion cmds/generate/workflow/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

"use strict";

exports.command = ['github [file]'];
exports.command = ['github [file]', 'github-actions [file]', 'gha [file]'];
exports.desc = 'Generate GitHub Actions workflow yaml file';
exports.builder = {
file: {
Expand Down
36 changes: 36 additions & 0 deletions cmds/generate/workflow/gitlab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['gitlab [file]', 'gitlab-runner [file]'];
exports.desc = 'Generate GitLab Runner workflow yaml file';
exports.builder = {
file: {
description: 'name of the test file; the default is `.gitlab-ci.yml`',
requiresArg: false,
type: 'array',
group: TITLE_CMD_OPTION,
},
};

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'generate/workflow/gitlab', argv.file);
};

36 changes: 36 additions & 0 deletions cmds/generate/workflow/travis-ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['travis-ci [file]'];
exports.desc = 'Generate Travis CI workflow yaml file';
exports.builder = {
file: {
description: 'name of the test file; the default is `.travis.yml`',
requiresArg: false,
type: 'array',
group: TITLE_CMD_OPTION,
},
};

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'generate/workflow/travis-ci', argv.file);
};

2 changes: 1 addition & 1 deletion docs/content/en/Continuous Integration/CircleCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ default: &default-steps
- checkout
- run: apt-get update && apt-get install -y git
- run: |
eask package
eask install
eask compile
eask lint package

# Enumerated list of Emacs versions
jobs:
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/Continuous Integration/GitHub Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:

- name: Run tests
run: |
eask package
eask install
eask compile
eask lint package
```

This example is testing your Emacs Lisp package in the below environment;
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/Continuous Integration/GitLab Runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pages:
- apt-get update
- apt-get install emacs -y
script:
- eask package
- eask install
- eask compile
- eask lint package
only:
- main
```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/Continuous Integration/Travis CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ install:
- npm install @emacs-eask/cli -g

script:
- eask package
- eask install
- eask compile
- eask lint package
```

This example is testing your Emacs Lisp package in the below environment;
Expand Down
34 changes: 33 additions & 1 deletion docs/content/en/Getting Started/Commands and options.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,44 @@ $ eask [GLOBAL-OPTIONS] generate pkg-file
[Multi-file Packages (elisp)](https://www.gnu.org/software/emacs/manual/html_node/elisp/Multi_002dfile-Packages.html#Multi_002dfile-Packages)
for details.

## 🔍 eask generate workflow circle-ci

Generate CircleCI workflow yaml file.

```sh
$ eask [GLOBAL-OPTIONS] generate workflow circle-ci [--file]
```

{{< hint info >}}
💡 This will generate the yaml file under `.circleci/`!
{{< /hint >}}

## 🔍 eask generate workflow github

Generate GitHub Actions workflow yaml file.

```sh
$ eask [GLOBAL-OPTIONS] generate workflow github
$ eask [GLOBAL-OPTIONS] generate workflow github [--file]
```

{{< hint info >}}
💡 This will generate the yaml file under `.github/workflow/`!
{{< /hint >}}

## 🔍 eask generate workflow gitlab

Generate GitLab Runner workflow yaml file.

```sh
$ eask [GLOBAL-OPTIONS] generate workflow gitlab [--file]
```

## 🔍 eask generate workflow travis-ci

Generate Travis CI workflow yaml file.

```sh
$ eask [GLOBAL-OPTIONS] generate workflow travis-ci [--file]
```

# 🚩 Linking
Expand Down
5 changes: 4 additions & 1 deletion lisp/checker/check-eask.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
;; $ eask check-eask [FILES..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [files..] specify Eask-files for checker to lint
;;
;; Optional arguments:
;;
;; --json Output lint result in JSON format
;;

Expand Down
2 changes: 1 addition & 1 deletion lisp/core/compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask compile [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] specify files to byte-compile
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/concat.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask concat [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] specify files to concatenate
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/emacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask emacs [args..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [args..] arguments feed into Emacs executable
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/exec.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask exec [args..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [args..] execute command with correct PATH set up
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/install.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask install [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] name of the package to install; else we try to install
;; package from current directory by calling function
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/reinstall.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask reinstall [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] name of the package to reinstall
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/run.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask run [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] run the script named <foo>
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/search.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask search [queries..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [queries..] query to search packages
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/uninstall.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask uninstall [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] name of the package to uninstall; else we uninstall pacakge
;; from current workspace
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/upgrade.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask upgrade [names..]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [names..] package to upgrade; else we upgrade all packages
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/create/elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask create elpa [name]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [name] new ELPA name
;;
Expand Down
2 changes: 1 addition & 1 deletion lisp/create/package.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; $ eask create package [name]
;;
;;
;; Initialization options:
;; Positional arguments:
;;
;; [name] new project name
;;
Expand Down
37 changes: 37 additions & 0 deletions lisp/generate/workflow/circle-ci.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
;;; generate/workflow/circle-ci.el --- Generate CircleCI workflow yaml file -*- lexical-binding: t; -*-

;;; Commentary:
;;
;; Command use generate CircleCI test yaml file,
;;
;; $ eask generate workflow circle-ci
;;
;;
;; Positional arguments:
;;
;; [--file] name of the test file; the default is `config.yml`
;;

;;; Code:

(let ((dir (file-name-directory (nth 1 (member "-scriptload" command-line-args)))))
(load (expand-file-name "_prepare.el"
(locate-dominating-file dir "_prepare.el"))
nil t))

(eask-start
(let* ((url "https://raw.githubusercontent.com/emacs-eask/template-generate/master/workflow/circle-ci.yml")
(dir (expand-file-name ".circleci/"))
(basename (or (car (eask-args)) "config.yml"))
(filename (expand-file-name basename dir))
(minimum-version (car (cdr (nth 0 eask-depends-on-emacs)))))
(ignore-errors (make-directory dir t))
(if (file-exists-p filename)
(eask-info "The yaml file already exists `%s`" filename)
(eask-with-progress
(format "Generating file %s... " filename)
(eask-with-verbosity 'debug (url-copy-file url filename))
"done ✓")
(eask-info "✓ Successfully created the yaml file in `%s`" filename))))

;;; generate/workflow/circle-ci.el ends here
Loading