Skip to content

Commit

Permalink
refactor(ci): Add changelog generation & Improve build workflow (#88)
Browse files Browse the repository at this point in the history
* Create RELEASE.tpl.md
* Create release.yml
* refactor(ci): Improve Rust build workflow
  • Loading branch information
mark-stopka committed Jan 26, 2022
1 parent 5077db2 commit 0d18685
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/chglog/RELEASE.tpl.md
@@ -0,0 +1,29 @@
{{ range .Versions }}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})

{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts

{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
36 changes: 36 additions & 0 deletions .github/chglog/release.yml
@@ -0,0 +1,36 @@
---
style: github
template: RELEASE.tpl.md
info:
repository_url: https://github.com/2nd-Layer/rust-cardano-ouroboros-network
options:
commits: {}
commit_groups:
sort_by: Custom
title_order:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
ci: Continuous Integration
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
60 changes: 53 additions & 7 deletions .github/workflows/rust.yaml
Expand Up @@ -11,12 +11,12 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build Rust with Cargo
build-linux:
name: Build Rust with Cargo on Linux
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest, windows-2022, macos-11]
os: [windows-latest, ubuntu-latest]
rust: [stable, nightly]
runs-on: ${{ matrix.os }}

Expand All @@ -28,16 +28,62 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --features experimental --verbose
run: cargo build --verbose
- name: Build examples
run: cargo build --examples --features experimental --verbose
run: cargo build --examples --verbose
- name: Run tests
run: cargo test --verbose

build-macos:
name: Build Rust with Cargo on Mac OS X
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-2022, macos-11]
rust: [stable, nightly]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --verbose
- name: Build examples
run: cargo build --examples --verbose
- name: Run tests
run: cargo test --verbose

build-windows:
name: Build Rust with Cargo on Windows
strategy:
fail-fast: false
matrix:
os: [windows-2022, windows-latest]
rust: [stable, nightly]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --verbose
- name: Build examples
run: cargo build --examples --verbose
- name: Run tests
run: cargo test --verbose

build_success:
name: Build Rust with Cargo - All environments
name: Build Rust with Cargo - Linux and Mac OS X
runs-on: ubuntu-latest
needs: build
needs: [build-linux, build-macos]
steps:
- run: echo Done!

Expand Down

0 comments on commit 0d18685

Please sign in to comment.