From 4e622adc879236a379765b8b2d9ac32ef4bda999 Mon Sep 17 00:00:00 2001 From: Justin Kulikauskas <44813129+JustinKuli@users.noreply.github.com> Date: Tue, 9 Nov 2021 16:36:29 -0500 Subject: [PATCH] Prepare for release (#17) * 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 * 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 --- .github/workflows/go-release.yml | 47 ++++++++++++++++++++++++++++++++ CHANGELOG/CHANGELOG-v0.5.0.md | 1 + 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/go-release.yml create mode 100644 CHANGELOG/CHANGELOG-v0.5.0.md diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml new file mode 100644 index 00000000..7a2eb7f1 --- /dev/null +++ b/.github/workflows/go-release.yml @@ -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 diff --git a/CHANGELOG/CHANGELOG-v0.5.0.md b/CHANGELOG/CHANGELOG-v0.5.0.md new file mode 100644 index 00000000..4b11e744 --- /dev/null +++ b/CHANGELOG/CHANGELOG-v0.5.0.md @@ -0,0 +1 @@ +# Initial release