Skip to content

Commit

Permalink
Prepare for release (#17)
Browse files Browse the repository at this point in the history
* Add a release workflow

The workflow will trigger on any tag pushed that looks like `v*.*.*`.
The action is based off of the one in the registration repo, but using
the build process in this repo.

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>

* Add changelog for v0.5.0

Since this is the first release for this repo, I did not fill in an
actual changelog. If we want to (in the future) we could use this file
as an initial feature list... but I don't think it's fully necessary.

Mostly this is so the auto-generated release doesn't have a broken link.

Signed-off-by: Justin Kulikauskas jkulikau@redhat.com
  • Loading branch information
JustinKuli committed Nov 9, 2021
1 parent 41e440b commit 4e622ad
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: GoRelease

on:
push:
tags:
- 'v*.*.*'

env:
GO_VERSION: '1.16'
TAG: ${{ github.ref_name }}
RELEASE_VERSION: ${{ github.ref_name }}
defaults:
run:
working-directory: go/src/open-cluster-management.io/config-policy-controller

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/config-policy-controller
- name: install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: build images
run: |
make build-images
- name: push image
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin
docker push quay.io/open-cluster-management/config-policy-controller:$RELEASE_VERSION
- name: generate changelog
run: |
echo "# config-policy-controller $RELEASE_VERSION" > /home/runner/work/changelog.txt
echo "- See the [CHANGELOG](https://github.com/open-cluster-management-io/config-policy-controller/blob/main/CHANGELOG/CHANGELOG-${RELEASE_VERSION}.md) for more details." >> /home/runner/work/changelog.txt
echo "- The released image is quay.io/open-cluster-management/config-policy-controller:$RELEASE_VERSION" >> /home/runner/work/changelog.txt
- name: publish release
uses: softprops/action-gh-release@v0.1.5
env:
GITHUB_TOKEN: ${{ github.token }}
with:
body_path: /home/runner/work/changelog.txt
1 change: 1 addition & 0 deletions CHANGELOG/CHANGELOG-v0.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Initial release

0 comments on commit 4e622ad

Please sign in to comment.