Skip to content

Commit

Permalink
Merge pull request #79 from DudeBro249/dev
Browse files Browse the repository at this point in the history
feat: docrunner release workflows
  • Loading branch information
srinivasayush authored Aug 1, 2021
2 parents acf669e + 9d7586c commit 79c1086
Show file tree
Hide file tree
Showing 424 changed files with 140,333 additions and 33 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Compile Dart Code

on:
push:
branches: [ stable ]

jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15]

steps:
- uses: actions/checkout@v2

# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603

- name: Install dependencies
run: dart pub get

- name: Build dart files
run: dart run build_runner build

- name: Compile code
run: dart compile exe bin/main.dart -o bin/docrunner-${{ matrix.os }}

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: ./bin/docrunner-${{ matrix.os }}*

release:
name: Create a github release
needs: [ build ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2

- name: Get version
uses: KJ002/read-yaml@v1.4
id: version
with:
file: ./pubspec.yaml
key-path: '["version"]'

- name: Get name
uses: KJ002/read-yaml@v1.4
id: name
with:
file: ./pubspec.yaml
key-path: '["name"]'

- name: Get changelog
uses: ./actions/changelog-action
id: changelog
with:
file: './CHANGELOG.md'

- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.name.outputs.data }}
tag_name: ${{ steps.version.outputs.data }}
body: ${{ steps.changelog.outputs.data }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/docrunner-ubuntu-20.04
asset_name: docrunner-linux
asset_content_type: application/octet-stream

- name: Upload macOS artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/docrunner-macOS-10.15
asset_name: docrunner-macOS
asset_content_type: application/octet-stream

- name: Upload windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/docrunner-windows-2019
asset_name: docrunner-windows.exe
asset_content_type: application/x-msdownload
3 changes: 1 addition & 2 deletions .github/workflows/dart_analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ jobs:
# - name: Verify formatting
# run: dart format --output=none --set-exit-if-changed .

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze
run: dart analyze --fatal-infos
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.0 (2021-08-01)

- Version 1.2.0
- Add continuous deployment and automatic release on push to `stable` branch.
- Add installation support for Linux and Mac.

## 1.1.1 (2021-06-04)

- Version 1.1.1.
Expand Down
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@ If you would like to contribute to docrunner please follow these instructions to

2. Clone your fork of this repository

3. Run this command in the root directory to install the necessary packages for the project:
3. Base all of your development of the `dev` branch

4. Run this command in the root directory to install the necessary packages for the project:
```shell
dart pub get
```

4. Run this command in the root directory to generate all necessary dart code:
5. Run this command in the root directory to generate all necessary dart code:
```shell
dart run build_runner build
```

5. To run the cli tool in development, run:
6. To run the cli tool in development, run:
```shell
dart run bin/main.dart
```

6. You're all set! You can now edit source code within the [`bin`](/bin) and [`lib`](/lib)
7. You're all set! You can now edit source code within the [`bin`](/bin) and [`lib`](/lib)
directories

7. (Optional) If you want to build and test a custom self-contained executable for the project,
8. (Optional) If you want to build and test a custom self-contained executable for the project,
you can run:
```shell
dart compile exe bin/main.dart
```
This will create `main.exe` in the [`bin`](/bin) folder
This will create binary file named `main` in the [`bin`](/bin) folder


For larger changes like adding support for another language, please open an issue
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@ Docrunner goes through your markdown file and runs any code in it, providing you

## Installation

Shell (Mac, Linux):
```shell
curl -fsSL https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.sh | sh
Bash (Linux):
```bash
curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-linux.sh | sudo bash
```

Bash (MacOS):

``` bash
curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-mac.sh | sudo bash
```

Powershell(Windows):
Powershell (Windows):
```powershell
iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.ps1 | iex
```

If none of these methods work, you can also install `docrunner.exe` from
[the releases](https://github.com/DudeBro249/docrunner/releases/tag/v1.1.1).
If none of these methods work, you can also install the `docrunner` binary from
[the releases](https://github.com/DudeBro249/docrunner/releases).
Make sure to add it to PATH so you can access it from anywhere

## QuickStart
Expand Down
15 changes: 15 additions & 0 deletions actions/changelog-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Read yaml'
description: 'Read data from a yaml file'

inputs:
file:
description: 'CHANGELOG file to read from.'
required: true

output:
data:
description: 'Most recent changelog.'

runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 79c1086

Please sign in to comment.