-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃懛 Release using GitHub Actions (#807)
- Loading branch information
1 parent
532d2a8
commit c9a1041
Showing
5 changed files
with
107 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v2.1.3 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
# libgbm-dev is required by Puppeteer 3+ | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get install -y libgbm-dev | ||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
npm ci --prefix packages/core | ||
- name: Lint, build and test | ||
env: | ||
ASCIIDOCTOR_CORE_VERSION: v2.0.10 | ||
run: | | ||
npm run lint | ||
npm run test | ||
npm run travis --prefix packages/core | ||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
# libgbm-dev is required by Puppeteer 3+ | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get install -y libgbm-dev | ||
# install dependencies | ||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
npm ci --prefix packages/core | ||
# package and publish | ||
- name: Package and publish | ||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
./scripts/package.sh | ||
./scripts/publish.sh | ||
./scripts/binaries.sh | ||
# create the GitHub release | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
# upload assets | ||
- name: Upload source code as a zip file | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: packages/core/bin/asciidoctor.js.dist.zip | ||
asset_name: asciidoctor.js.dist.zip | ||
asset_content_type: application/zip | ||
- name: Upload source code as a tar.gz file | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: packages/core/bin/asciidoctor.js.dist.tar.gz | ||
asset_name: asciidoctor.js.dist.tar.gz | ||
asset_content_type: application/tar+gzip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Produce macOS, Linux and Windows binaries from asciidoctor/cli | ||
|
||
SCRIPT=`realpath $0` | ||
SCRIPT_PATH=`dirname ${SCRIPT}` | ||
|
||
cd "$SCRIPT_PATH" | ||
cd ../packages/asciidoctor | ||
|
||
# @asciidoctor/core must be published to npmjs before we can install the dependencies | ||
npm i --prefix packages/asciidoctor | ||
npm run dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters