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

ci: Add draft version of the release workflow #101

Merged
merged 2 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/chglog/RELEASE.tpl.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
style: github
template: RELEASE.tpl.md
info:
repository_url: https://github.com/txpipe/pallas
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
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release
on:
#push:
# tags:
# - "v*"
workflow_dispatch: {}

jobs:
cargo_publish:
name: Publish to Crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0

- name: Setup Rust Toolchain
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal

- name: Setup Cargo Plugins
uses: actions-rs/cargo@v1.0.3
with:
command: install
args: cargo-workspaces

github_release:
name: Create GitHub Release
needs: [cargo_publish]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.16"

- name: Release Notes
run: |
go install github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.0
git-chglog -c .github/chglog/release.yml $(git describe --tags) > RELEASE.md

- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
draft: true