-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup release github actions (PROJQUAY-1468)
- Loading branch information
Tom McKay
committed
Apr 9, 2021
1 parent
8d408b1
commit 7de24bc
Showing
8 changed files
with
324 additions
and
24 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,50 @@ | ||
## Red Hat Quay Release Notes | ||
(Red Hat Customer Portal)[https://access.redhat.com/documentation/en-us/red_hat_quay/3.5/html/red_hat_quay_release_notes/index] | ||
|
||
{{ 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 -}} | ||
|
||
## Historical Changelog | ||
[CHANGELOG.md](https://github.com/quay/quay/blob/96b17b8338fb10ca2ed12e9bc920dcbba148289c/CHANGELOG.md) |
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,30 @@ | ||
style: github | ||
template: CHANGELOG.tpl.md | ||
info: | ||
title: CHANGELOG | ||
repository_url: https://github.com/quay/quay | ||
options: | ||
tag_sort_by: semver | ||
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,64 @@ | ||
# How to Contribute | ||
|
||
The Quay-Operator is [Apache 2.0 licensed](LICENSE) and accepts contributions via GitHub pull requests. | ||
This document outlines some of the conventions on development workflow, commit message formatting, contact points and other resources to make it easier to get your contribution accepted. | ||
|
||
# Certificate of Origin | ||
|
||
By contributing to this project you agree to the Developer Certificate of Origin [DCO](../DCO). | ||
This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. | ||
See the [DCO](../DCO) file for details. | ||
|
||
# Email and Chat | ||
|
||
The project currently uses a mailing list and IRC channel: | ||
|
||
- Issues: [PROJQUAY Jira](https://issues.redhat.com/projects/PROJQUAY/issues) | ||
- Email: [[email protected]](https://groups.google.com/g/quay-sig) | ||
- IRC: #[quay](irc://irc.freenode.org:6667/#quay) IRC channel on freenode.org | ||
|
||
Please avoid emailing maintainers directly. | ||
They are very busy and read the mailing lists. | ||
|
||
## Getting Started | ||
|
||
- Fork the repository on [GitHub](https://github.com/quay/quay-operator) | ||
- Read the [README](../README.md) for build and test instructions | ||
- Play with the project, submit bugs, submit patches! | ||
|
||
## Contribution Flow | ||
|
||
This is a rough outline of what a contributor's workflow looks like: | ||
|
||
- All changes require a referenced [PROJQUAY Jira](https://issues.redhat.com/projects/PROJQUAY/issues) | ||
- Create a topic branch from where you want to base your work (usually main). | ||
- Make commits of logical units. | ||
- Make sure your commit messages are in the proper format (see below). | ||
- Push your changes to a topic branch in your fork of the repository. | ||
- Make sure the tests pass, and add any new tests as appropriate. | ||
- Submit a pull request to the original repository. | ||
|
||
Thanks for your contributions! | ||
|
||
### Format of the Commit Message | ||
|
||
We follow a rough convention for commit messages that is designed to answer two questions: what changed and why. | ||
The subject line should feature the what and the body of the commit should describe the why. | ||
|
||
``` | ||
scripts: add the test-cluster command (PROJQUAY-1234) | ||
this uses tmux to setup a test cluster that you can easily kill and | ||
start for debugging. | ||
``` | ||
|
||
The format can be described more formally as follows: | ||
|
||
``` | ||
<subsystem>: <what changed> (PROJQUAY-####) | ||
<BLANK LINE> | ||
<why this change was made> | ||
``` | ||
|
||
The first line is the subject and should be no longer than 70 characters, the second line is always blank, and other lines should be wrapped at 80 characters. | ||
This allows the message to be easier to read on GitHub as well as in various git tools. |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v3.* | ||
workflow_dispatch: {} # This puts a button in the UI for testing. | ||
|
||
jobs: | ||
release-archive: | ||
name: Create Release Archive | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Setup | ||
run: | | ||
tag=`basename ${{ github.ref }}` | ||
echo "PREFIX=quay-${tag}/" >> $GITHUB_ENV | ||
echo "TAG=${tag}" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Create Release Archive | ||
# any additional files can be added by appending to the tar | ||
# created by `git archive`. For example: | ||
# | ||
# tar -rf release.tar --transform "s,^,${PREFIX}," vendor | ||
run: | | ||
git archive --prefix "${PREFIX}" -o release.tar "${GITHUB_REF}" | ||
gzip release.tar | ||
- name: ChangeLog | ||
shell: bash | ||
run: | | ||
#if [ "${{ github.event_name }}" = workflow_dispatch ]; then | ||
# echo "workflow trigger, skipping" | ||
# touch changelog | ||
# exit 0 | ||
#fi | ||
curl -o /tmp/git-chglog -L https://github.com/ldelossa/git-chglog/releases/download/v0.11.2-sortbysemver/linux.amd64.git-chglog | ||
chmod u+x /tmp/git-chglog | ||
echo "creating change log for tag: $TAG" | ||
/tmp/git-chglog --tag-filter-pattern "v3.*" "${TAG}" > changelog | ||
- name: Upload Release Archive | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release | ||
path: | | ||
release.tar.gz | ||
changelog | ||
if-no-files-found: error | ||
|
||
release: | ||
name: Release | ||
runs-on: 'ubuntu-latest' | ||
if: github.event_name == 'push' | ||
needs: [release-archive] | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Setup | ||
run: | | ||
tag=`basename ${{ github.ref }}` | ||
echo "VERSION=${tag}" >> $GITHUB_ENV | ||
- name: Fetch Artifacts | ||
uses: actions/download-artifact@v2 | ||
id: download | ||
with: | ||
name: release | ||
- name: Create Release | ||
uses: actions/create-release@latest | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ env.VERSION }} Release | ||
body_path: ${{steps.download.outputs.download-path}}/changelog | ||
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') || contains(env.VERSION, 'rc') }} | ||
- name: Publish Release Archive | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{steps.download.outputs.download-path}}/release.tar.gz | ||
asset_name: quay-${{ env.VERSION }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
publish-container: | ||
name: Publish Container | ||
runs-on: 'ubuntu-latest' | ||
needs: [release-archive, release] | ||
steps: | ||
- name: Setup | ||
run: | | ||
tag=`basename ${{ github.ref }}` | ||
echo "QUAY_VERSION=${tag}" >> $GITHUB_ENV | ||
echo "TAG=quay.io/projectquay/quay:${tag#v}" >> $GITHUB_ENV | ||
echo "QUAY_USER=projectquay+quay_github" >> $GITHUB_ENV | ||
echo "::add-mask::${{ secrets.QUAY_TOKEN }}" | ||
- name: Fetch Artifacts | ||
uses: actions/download-artifact@v2 | ||
id: download | ||
with: | ||
name: release | ||
- name: Build Release Container | ||
run: | | ||
d=$(mktemp -d) | ||
trap 'rm -rf "$d"' EXIT | ||
tar -xz -f ${{steps.download.outputs.download-path}}/release.tar.gz --strip-components=1 -C "$d" | ||
docker build --build-arg QUAY_VERSION --tag "${TAG}" "$d" | ||
- name: Publish Release Container | ||
run: | | ||
docker login -u "${QUAY_USER}" -p '${{ secrets.QUAY_TOKEN }}' quay.io | ||
docker push "${TAG}" |
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,47 @@ | ||
--- | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'the branch to prepare the release against' | ||
required: true | ||
default: 'master' | ||
tag: | ||
description: 'the tag to be released' | ||
rdequired: true | ||
jira: | ||
description: 'PROJQUAY jira release issue' | ||
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 | ||
env: | ||
exe: /tmp/git-chlog | ||
run: | | ||
curl -o "${exe}" -fsSL\ | ||
https://github.com/git-chglog/git-chglog/releases/download/0.9.1/git-chglog_linux_amd64 | ||
chmod u+x "${exe}" | ||
echo "creating change log for tag: ${{ github.event.inputs.tag }}" | ||
"${exe}"\ | ||
--next-tag "${{ github.event.inputs.tag }}"\ | ||
-o CHANGELOG.md | ||
- name: Create Pull Request | ||
uses: peter-evans/[email protected] | ||
with: | ||
title: "${{ github.event.inputs.tag }} Changelog Bump" | ||
body: "This is an automated changelog commit." | ||
commit-message: "chore: ${{ github.event.inputs.tag }} changelog bump (${{ github.event.inputs.jira }})" | ||
branch: "ready-${{ github.event.inputs.tag }}" | ||
signoff: true | ||
delete-branch: true |
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 @@ | ||
empty |