ci: add release-please to automate release creation (#3847)
This commit is contained in:
parent
b3134665e8
commit
c96e2736f8
|
@ -1,49 +0,0 @@
|
||||||
{{ if .Versions -}}
|
|
||||||
<a name="unreleased"></a>
|
|
||||||
## [Unreleased]
|
|
||||||
|
|
||||||
{{ if .Unreleased.CommitGroups -}}
|
|
||||||
{{ range .Unreleased.CommitGroups -}}
|
|
||||||
### {{ .Title }}
|
|
||||||
{{ range .Commits -}}
|
|
||||||
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
|
|
||||||
{{ range .Versions }}
|
|
||||||
<a name="{{ .Tag.Name }}"></a>
|
|
||||||
## {{ if .Tag.Previous }}[{{ .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 -}}
|
|
||||||
|
|
||||||
{{- if .Versions }}
|
|
||||||
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
|
|
||||||
{{ range .Versions -}}
|
|
||||||
{{ if .Tag.Previous -}}
|
|
||||||
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
|
@ -1,29 +0,0 @@
|
||||||
{{ 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 -}}
|
|
|
@ -1,37 +0,0 @@
|
||||||
---
|
|
||||||
style: github
|
|
||||||
template: CHANGELOG.tpl.md
|
|
||||||
info:
|
|
||||||
title: CHANGELOG
|
|
||||||
repository_url: https://github.com/starship/starship
|
|
||||||
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
|
|
|
@ -1,36 +0,0 @@
|
||||||
---
|
|
||||||
style: github
|
|
||||||
template: RELEASE.tpl.md
|
|
||||||
info:
|
|
||||||
repository_url: https://github.com/starship/starship
|
|
||||||
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
|
|
|
@ -1,8 +1,8 @@
|
||||||
name: Deploy
|
name: Deploy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- "v*"
|
- master
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
CARGO_NET_RETRY: 10
|
CARGO_NET_RETRY: 10
|
||||||
|
@ -10,9 +10,25 @@ env:
|
||||||
RUSTUP_MAX_RETRIES: 10
|
RUSTUP_MAX_RETRIES: 10
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Update release PR
|
||||||
|
release_please:
|
||||||
|
name: Release Please
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
release_created: ${{ steps.release.outputs.release_created }}
|
||||||
|
tag_name: ${{ steps.release.outputs.tag_name }}
|
||||||
|
steps:
|
||||||
|
- uses: google-github-actions/release-please-action@v3
|
||||||
|
id: release
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
release-type: rust
|
||||||
|
|
||||||
# Build sources for every OS
|
# Build sources for every OS
|
||||||
github_build:
|
github_build:
|
||||||
name: Build release binaries
|
name: Build release binaries
|
||||||
|
needs: release_please
|
||||||
|
if: ${{ needs.release_please.outputs.release_created }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -200,9 +216,9 @@ jobs:
|
||||||
security delete-keychain $KEYCHAIN_PATH
|
security delete-keychain $KEYCHAIN_PATH
|
||||||
|
|
||||||
# Create GitHub release with Rust build targets and release notes
|
# Create GitHub release with Rust build targets and release notes
|
||||||
github_release:
|
upload_artifacts:
|
||||||
name: Create GitHub Release
|
name: Add Build Artifacts to Release
|
||||||
needs: [github_build, notarize_and_pkgbuild]
|
needs: [release_please, github_build, notarize_and_pkgbuild]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup | Checkout
|
- name: Setup | Checkout
|
||||||
|
@ -210,33 +226,24 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup | Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: "1.16"
|
|
||||||
|
|
||||||
- name: Setup | Artifacts
|
- name: Setup | Artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
|
||||||
- name: Setup | Checksums
|
- name: Setup | Checksums
|
||||||
run: for file in starship-*/starship-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
|
run: for file in starship-*/starship-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
|
||||||
|
|
||||||
- name: Setup | Release notes
|
- name: Build | Add Artifacts to Release
|
||||||
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: Build | Publish
|
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: starship-*/starship-*
|
files: starship-*/starship-*
|
||||||
body_path: RELEASE.md
|
tag_name: ${{ needs.release_please.outputs.release_created }}
|
||||||
|
|
||||||
# Publish starship to Crates.io
|
# Publish starship to Crates.io
|
||||||
cargo_publish:
|
cargo_publish:
|
||||||
name: Publish Cargo Package
|
name: Publish Cargo Package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: github_release
|
needs: release_please
|
||||||
|
if: ${{ needs.release_please.outputs.release_created }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup | Checkout
|
- name: Setup | Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -254,7 +261,8 @@ jobs:
|
||||||
update_brew_formula:
|
update_brew_formula:
|
||||||
name: Update Brew Formula
|
name: Update Brew Formula
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: github_release
|
needs: release_please
|
||||||
|
if: ${{ needs.release_please.outputs.release_created }}
|
||||||
steps:
|
steps:
|
||||||
- uses: mislav/bump-homebrew-formula-action@v1.16
|
- uses: mislav/bump-homebrew-formula-action@v1.16
|
||||||
with:
|
with:
|
||||||
|
@ -265,7 +273,8 @@ jobs:
|
||||||
publish_docs:
|
publish_docs:
|
||||||
name: Publish docs to Netlify
|
name: Publish docs to Netlify
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: github_release
|
needs: release_please
|
||||||
|
if: ${{ needs.release_please.outputs.release_created }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup | Checkout
|
- name: Setup | Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
name: Format + Docs Workflow
|
name: Format + Docs Workflow
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
Loading…
Reference in New Issue