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

feat: docrunner release workflows #79

Merged
merged 38 commits into from
Aug 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8e477d2
:test_tube: add build workflow
jbutcher5 Jul 28, 2021
0a14239
:fire: remove workflow execution on pull request to stable
jbutcher5 Jul 28, 2021
633033e
:wrench: change workflow name
jbutcher5 Jul 28, 2021
81823e7
:construction: add test release job
jbutcher5 Jul 28, 2021
b6d13b5
:wrench: depend on build job for release job to run
jbutcher5 Jul 29, 2021
9b322a4
:wrench: change binary name and upload binary only
jbutcher5 Jul 29, 2021
37f4778
:construction: add test file structure output
jbutcher5 Jul 29, 2021
5e860c7
:wrench: Add details to create release
jbutcher5 Jul 30, 2021
092d203
:hammer: Upload artifact binaries
jbutcher5 Jul 30, 2021
19c1444
:hammer: Add full name of binary
jbutcher5 Jul 30, 2021
5f3da9c
:wrench: Update version and remove changelog
jbutcher5 Jul 30, 2021
a704dac
:construction_worker: Add custom workflow action
jbutcher5 Jul 31, 2021
070e90a
:hammer: Update changelog action
jbutcher5 Jul 31, 2021
2e0ed64
:hammer: Run action from file instead of producing a syntax error
jbutcher5 Jul 31, 2021
aa6c8f0
:wrench: Change file to be required
jbutcher5 Jul 31, 2021
95bd359
:hammer: Change default file
jbutcher5 Jul 31, 2021
7dec677
:wrench: Remove default file
jbutcher5 Jul 31, 2021
ef9ddc1
:test_tube: Add debug code
jbutcher5 Jul 31, 2021
4eed8f3
:test_tube: Alter debug code
jbutcher5 Jul 31, 2021
6f8e2d8
:test_tube: Update test version
jbutcher5 Jul 31, 2021
2e38ddc
:fire: Remove changelog-action and relocate to KJ002/changelog-action
jbutcher5 Jul 31, 2021
37eb6b1
:test_tube: Added debug step
jbutcher5 Jul 31, 2021
6bb0a46
:construction_worker: Reimplement changelog-action locally
jbutcher5 Jul 31, 2021
6a90031
:hammer: Fix changelog-action
jbutcher5 Jul 31, 2021
fac09c4
:fire: Remove debug action triggers
jbutcher5 Jul 31, 2021
f82e794
:hammer: Add test build
jbutcher5 Jul 31, 2021
f03ff8c
:memo: Update CONTRIBUTING documentation
jbutcher5 Jul 31, 2021
56e10b5
:adhesive_bandage: Add dynamic version installation and support both …
jbutcher5 Aug 1, 2021
5b0c5d8
:wrench: Add linux and macos install scripts
jbutcher5 Aug 1, 2021
a7b8adb
:memo: Update installation documentation
jbutcher5 Aug 1, 2021
9bb042c
:fire: remove install.sh
jbutcher5 Aug 1, 2021
e8bf0a8
:hammer: Check for fatal build errors on code analysis
jbutcher5 Aug 1, 2021
4396880
:fire: dart_analyze.yml takes the position of this workflow.
jbutcher5 Aug 1, 2021
a5f6c1d
:truck: Move location of changelog-action
jbutcher5 Aug 1, 2021
57f85f9
:hammer: Update changelog-action entrypoint for action
jbutcher5 Aug 1, 2021
6fa226d
:hammer: Update version to correct version
jbutcher5 Aug 1, 2021
e9714bc
:memo: Update changelog to detail changes in current version.
jbutcher5 Aug 1, 2021
9d7586c
Merge pull request #78 from KJ002/dev
srinivasayush Aug 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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