From bd590fbb7f6cedb45e39bda52bcd03947fb164c0 Mon Sep 17 00:00:00 2001 From: Zhiwei Yin Date: Tue, 13 Jul 2021 14:42:35 +0800 Subject: [PATCH] add release action job Signed-off-by: Zhiwei Yin --- .github/workflows/go-presubmit.yml | 2 +- .github/workflows/go-release.yml | 57 ++++++++++++++++++++++++++++++ CHANGELOG/CHANGELOG-v0.4.md | 23 ++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/go-release.yml create mode 100644 CHANGELOG/CHANGELOG-v0.4.md diff --git a/.github/workflows/go-presubmit.yml b/.github/workflows/go-presubmit.yml index 415318b68..66b12be95 100644 --- a/.github/workflows/go-presubmit.yml +++ b/.github/workflows/go-presubmit.yml @@ -117,7 +117,7 @@ jobs: - name: setup kind uses: engineerd/setup-kind@v0.5.0 with: - version: v0.10.0 + version: v0.11.1 - name: Load image on the nodes of the cluster run: | kind load docker-image --name=kind quay.io/open-cluster-management/work:latest diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml new file mode 100644 index 000000000..238a83989 --- /dev/null +++ b/.github/workflows/go-release.yml @@ -0,0 +1,57 @@ +name: GoRelease + +on: + push: + tags: + - 'v*.*.*' +env: + # Common versions + GO_VERSION: '1.16' + GO_REQUIRED_MIN_VERSION: '' + GOPATH: '/home/runner/work/work/work/go' + GITHUB_REF: ${{ github.ref }} + +defaults: + run: + working-directory: go/src/open-cluster-management.io/work + +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/work + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + - name: install imagebuilder + run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.1 + - name: images + run: make images + - name: get release version + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: get major release version + run: | + echo "MAJOR_RELEASE_VERSION=${RELEASE_VERSION%.*}" >> $GITHUB_ENV + - name: push image + run: | + echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin + docker tag quay.io/open-cluster-management/work:latest quay.io/open-cluster-management/work:$RELEASE_VERSION + docker push quay.io/open-cluster-management/work:$RELEASE_VERSION + - name: generate changelog + run: | + echo "# Work $RELEASE_VERSION" > /home/runner/work/changelog.txt + echo "- See the [CHANGELOG](https://github.com/open-cluster-management.io/work/blob/main/CHANGELOG/CHANGELOG-${MAJOR_RELEASE_VERSION}.md) for more details." >> /home/runner/work/changelog.txt + echo "- The released image is quay.io/open-cluster-management/work:$RELEASE_VERSION" >> /home/runner/work/changelog.txt + - name: publish release + uses: softprops/action-gh-release@v0.1.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body_path: /home/runner/work/changelog.txt diff --git a/CHANGELOG/CHANGELOG-v0.4.md b/CHANGELOG/CHANGELOG-v0.4.md new file mode 100644 index 000000000..e6c8d94ca --- /dev/null +++ b/CHANGELOG/CHANGELOG-v0.4.md @@ -0,0 +1,23 @@ +# Changelog since v0.3.0 +All notable changes to this project will be documented in this file. + +## v0.4.0 + +### New Features + N/C + +### Added +* Upgrade CRD to v1 and k8s lib to v0.21.0-rc.0. +* Upgrade Golang to 1.6. +* Add manifests size verification. + +### Changes +* Replace resource mapper with dynamicRESTMapper. + + +### Bug Fixes +* Fix issue that applying resource slowly. +* Fix e2e issues. + +### Removed & Deprecated + N/C