-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cicd: automated changelog and release
Signed-off-by: ldelossa <ldelossa@redhat.com>
- Loading branch information
Showing
7 changed files
with
230 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{ if .Versions -}} | ||
<a name="unreleased"></a> | ||
## [Unreleased] | ||
|
||
{{ if .Unreleased.CommitGroups -}} | ||
{{ range .Unreleased.CommitGroups -}} | ||
### {{ .Title }} | ||
{{ range .Commits -}} | ||
- [{{.Hash.Short}}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}): {{ .Subject }} | ||
{{ if .Refs -}}{{ range .Refs }} -{{if .Action}}{{ .Action }} {{ end }} [#{{ .Ref }}]({{ $.Info.RepositoryURL }}/issues/{{ .Ref }}){{ end -}} | ||
{{ 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 -}} | ||
- [{{.Hash.Short}}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}): {{ .Subject }} | ||
{{ if .Refs -}}{{ range .Refs }} - {{if .Action}}{{ .Action }}{{ end }} [#{{ .Ref }}]({{ $.Info.RepositoryURL }}/issues/{{ .Ref }}){{ end -}} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} | ||
|
||
{{- if .RevertCommits -}} | ||
### Reverts | ||
{{ range .RevertCommits -}} | ||
- {{ .Revert.Header }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .MergeCommits -}} | ||
### Pull Requests | ||
{{ range .MergeCommits -}} | ||
- {{ .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 -}} | ||
{{ end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
style: github | ||
template: CHANGELOG.tpl.md | ||
info: | ||
title: CHANGELOG | ||
repository_url: https://github.com/go-jira/go-jira | ||
options: | ||
commits: | ||
sort_by: Scope | ||
commit_groups: | ||
group_by: Scope | ||
header: | ||
pattern: '^(.*):\s*(.*)$' | ||
pattern_maps: | ||
- Scope | ||
- Subject | ||
issues: | ||
prefix: | ||
- "#" | ||
|
||
refs: | ||
actions: | ||
- Closes | ||
- Fixes | ||
- PullRequest | ||
|
||
notes: | ||
keywords: | ||
- BREAKING CHANGE | ||
- NOTE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'the branch to prepare the release against' | ||
required: true | ||
deault: 'master' | ||
tag: | ||
description: 'the tag to be released' | ||
required: true | ||
|
||
jobs: | ||
prepare: | ||
name: Prepare Release | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.branch }} | ||
- name: Changelog | ||
shell: bash | ||
run: | | ||
curl -o /tmp/git-chglog -L https://github.com/git-chglog/git-chglog/releases/download/0.9.1/git-chglog_linux_amd64 | ||
chmod u+x /tmp/git-chglog | ||
echo "creating change log for tag: ${{ github.event.inputs.tag }}" | ||
/tmp/git-chglog --next-tag "${{ github.event.inputs.tag }}" -o CHANGELOG.md | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3.1.2 | ||
with: | ||
title: "${{ github.event.inputs.tag }} Changelog Bump" | ||
body: "This is an automated changelog commit." | ||
commit-message: "chore: ${{ github.event.inputs.tag }} changelog bump" | ||
branch: "ready-${{ github.event.inputs.tag }}" | ||
signoff: "gh-actions" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v1.* | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Setup | ||
run: | | ||
tag=`basename ${{ github.ref }}` | ||
cat <<. | ||
::set-env name=VERSION::${tag} | ||
. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: ChangeLog | ||
shell: bash | ||
run: | | ||
curl -o git-chglog -L https://github.com/git-chglog/git-chglog/releases/download/0.9.1/git-chglog_linux_amd64 | ||
chmod u+x git-chglog | ||
tag=`basename ${{ github.ref }}` | ||
echo "creating change log for tag: $tag" | ||
chglog="$(./git-chglog ${tag})" | ||
chglog="${chglog//'%'/'%25'}" | ||
chglog="${chglog//$'\n'/'%0A'}" | ||
chglog="${chglog//$'\r'/'%0D'}" | ||
cat <<. | ||
::set-env name=CHANGELOG::${chglog} | ||
. | ||
- name: Create Release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ env.VERSION}} Release | ||
body: | | ||
${{ env.CHANGELOG }} | ||
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') || contains(env.VERSION, 'rc') }} | ||
# perform production release of artifacts | ||
- name: Build Artifacts | ||
run: | | ||
VERSION=${{ env.VERSION }} make all | ||
- name: "Publish Darwin AMD64" | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/github.com/go-jira/jira-drawin-amd64 | ||
asset_name: jira-drawin-amd64 | ||
asset_content_type: application/octet-stream | ||
- name: "Publish Linux 386" | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/github.com/go-jira/jira-linux-386 | ||
asset_name: jira-linux-386 | ||
asset_content_type: application/octet-stream | ||
- name: "Publish Linux AMD64" | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/github.com/go-jira/jira-linux-amd64 | ||
asset_name: jira-linux-amd64 | ||
asset_content_type: application/octet-stream | ||
- name: "Publish Windows 386" | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/github.com/go-jira/jira-windows-386.exe | ||
asset_name: jira-windows-386.exe | ||
asset_content_type: application/octet-stream | ||
- name: "Publish Windows AMD64" | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/github.com/go-jira/jira-windows-amd64.exe | ||
asset_name: jira-windows-amd64.exe | ||
asset_content_type: application/octet-stream | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters