Skip to content

Commit

Permalink
Release script
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Oct 6, 2019
1 parent ebbfa38 commit 2ade255
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 4 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ jobs:
# Try 3 times because this sometimes fails due to network error
# on GitHub Actions.
stack setup || stack setup || stack setup
- name: Check version
if: >-
github.event_name != 'pull_request' &&
startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
pkg_ver="$(stack query locals seonbi version)"
echo "Package version: $pkg_ver"
tag_ver="${GITHUB_REF:10}"
echo "Git tag version: $tag_ver"
[[ "$tag_ver" = "$pkg_ver" ]]
! grep -i "to be released" CHANGES.md
- name: Resolve dependencies
run: stack install --only-dependencies
- name: Build
Expand Down Expand Up @@ -204,3 +216,79 @@ jobs:
with:
name: dists
path: /tmp/dists

release:
name: Release dist files
needs:
- build
- binaries
runs-on: ubuntu-18.04
steps:
- uses: actions/download-artifact@v1
with:
name: sdist-ubuntu-18.04-lts-14.7
path: /tmp/sdist
- uses: actions/download-artifact@v1
with:
name: dists
path: /tmp/dists
- if: >-
github.event_name != 'pull_request' &&
startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p "$HOME/bin"
export PATH="$HOME/bin:$PATH"
curl -L -o "$HOME/bin/submark" \
https://github.com/dahlia/submark/releases/download/0.2.0/submark-linux-x86_64
chmod +x "$HOME/bin/submark"
curl -L -o /tmp/github-release.tar.bz2 \
https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
tar xvfj /tmp/github-release.tar.bz2 -C /tmp
mv /tmp/bin/linux/amd64/github-release $HOME/bin
version="${GITHUB_REF:10}"
github_user="${GITHUB_REPOSITORY%/*}"
github_repo="${GITHUB_REPOSITORY#*/}"
# Release note
submark -iO --h2 "Version $version" \
| github-release release \
--user "$github_user" \
--repo "$github_repo" \
--tag "$version" \
--name "Seonbi $version" \
--description -
# Source distribution
for file in /tmp/sdist/*; do
github-release upload \
--user "$github_user" \
--repo "$github_repo" \
--tag "$version" \
--name "$(basename "$file")" \
--file "$file"
done
# Binaries
for file in /tmp/dists/*; do
github-release upload \
--user "$github_user" \
--repo "$github_repo" \
--tag "$version" \
--name "$(basename "$file")" \
--file "$file"
done
- if: >-
github.event_name != 'pull_request' &&
startsWith(github.ref, 'refs/tags/')
env:
HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
run: |
for file in /tmp/sdist/*; do
curl \
-H "Authorization: X-ApiKey $HACKAGE_API_KEY" \
-F package=@"$file" \
https://hackage.haskell.org/packages/
done
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Seonbi: SmartyPants for Korean language
=======================================

[![][ci-status-badge]][ci] [![][dockerhub-badge]][dockerhub]
[![][releases-badge]][releases] [![][hackage-badge]][hackage] [![][dockerhub-badge]][dockerhub] [![][ci-status-badge]][ci]

Seonbi (선비) is is an HTML preprocessor that makes typographic adjustments
to an HTML so that the result uses accurate punctuations according to
Expand Down Expand Up @@ -37,22 +37,32 @@ markup languages like CommonMark, Markdown, and Textile. In a similar way to
SmartyPants, it either does not modify characters within several sensitive
HTML elements like `<pre>`/`<code>`/`<script>`/`<kbd>`.

[ci]: https://github.com/dahlia/seonbi/actions
[ci-status-badge]: https://github.com/dahlia/seonbi/workflows/build/badge.svg
[releases]: https://github.com/dahlia/seonbi/releases
[releases-badge]: https://img.shields.io/github/v/release/dahlia/seonbi
[hackage]: https://hackage.haskell.org/package/seonbi
[hackage-badge]: https://img.shields.io/hackage/v/seonbi
[dockerhub]: https://hub.docker.com/r/dahlia/seonbi
[dockerhub-badge]: https://img.shields.io/microbadger/image-size/dahlia/seonbi
[ci]: https://github.com/dahlia/seonbi/actions
[ci-status-badge]: https://github.com/dahlia/seonbi/workflows/build/badge.svg
[SmartyPants]: https://daringfireball.net/projects/smartypants/
[Korean mixed script]: https://en.wikipedia.org/wiki/Korean_mixed_script


Installation
------------

Seonbi is distributed as a [Docker image][dockerhub]:
Seonbi provides the official executable binaries for Linux (x86_64), macOS,
and Windows (64-bit). You can find download them from the [releases] page.

It is also distributed as a [Docker image][dockerhub]:

$ echo '訓民正音' | docker run -i dahlia/seonbi:latest seonbi
훈민정음

If you want to use it as a Haskell library install the [seonbi][hackage] package
using Stack or Cabal.


CLI
---
Expand Down

0 comments on commit 2ade255

Please sign in to comment.