Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate GitHub release with uploading standalone binary assets #88

Merged
merged 6 commits into from
May 7, 2019
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
40 changes: 35 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ references:
cmd:
- /bin/sh

on-tagged-version: &on-tagged-version
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/

base: &base
docker:
- image: circleci/node:10.15.3-browsers
Expand Down Expand Up @@ -105,10 +112,32 @@ jobs:
- run: yarn install
- run: yarn build:standalone

- persist_to_workspace:
root: ./bin
paths:
- '*'

- store_artifacts:
path: ./bin
destination: bin

github-release:
<<: *base
steps:
- checkout

- attach_workspace:
at: ./bin

- run:
name: Create release and upload binaries on GitHub
command: |
RELEASE_ID=$(curl -sS https://raw.githubusercontent.com/marp-team/marp/master/github-release.js | node) && \
ENDPOINT="https://uploads.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/${RELEASE_ID}/assets" && \
curl -sS --data-binary @"bin/marp-cli-linux" -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" ${ENDPOINT}?name=marp-${CIRCLE_TAG}-linux && \
curl -sS --data-binary @"bin/marp-cli-macos" -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" ${ENDPOINT}?name=marp-${CIRCLE_TAG}-mac && \
curl -sS --data-binary @"bin/marp-cli-win.exe" -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" ${ENDPOINT}?name=marp-${CIRCLE_TAG}-win

workflows:
version: 2
build:
Expand All @@ -123,8 +152,9 @@ workflows:
branches:
only: master
- standalone-build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
<<: *on-tagged-version
- github-release:
<<: *on-tagged-version
context: github-release
requires:
- standalone-build
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
### Added

- Shorthand for setting text color via image syntax, from [Marpit v1.0.0](https://github.com/marp-team/marpit/releases/v1.0.0) ([#86](https://github.com/marp-team/marp-cli/pull/86))
- Build standalone executable binaries _(Experimental)_ ([#87](https://github.com/marp-team/marp-cli/pull/87))
- Standalone executable binaries _(Experimental)_ ([#87](https://github.com/marp-team/marp-cli/pull/87), [#88](https://github.com/marp-team/marp-cli/pull/88))
- Automate GitHub release ([#88](https://github.com/marp-team/marp-cli/pull/88))

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ You can install with `-g` option if you want to use `marp` command globally.
npm install -g @marp-team/marp-cli
```

### Standalone binary _(EXPERIMENTAL)_

Do you never want to install any dependent tools? we also provide executable binaries for Linux, macOS, and Windows. [:fast_forward: Download the latest standalone binary for your OS from release page.](https://github.com/marp-team/marp-cli/releases)

## Basic usage

### Convert to HTML
Expand Down