From a9cacc615e62c1c43aebebfd3287b4ea19deba6b Mon Sep 17 00:00:00 2001 From: Mike Ng Date: Thu, 26 Aug 2021 12:40:47 -0400 Subject: [PATCH 1/2] add github action for release Signed-off-by: Mike Ng --- .github/workflows/go-release.yml | 57 ++++++++++++++++++++++++++++++++ CHANGELOG/CHANGELOG-v0.4.md | 13 ++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/go-release.yml create mode 100644 CHANGELOG/CHANGELOG-v0.4.md diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml new file mode 100644 index 00000000..fe03e903 --- /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/multicloud-operators-channel/multicloud-operators-channel/go' + GITHUB_REF: ${{ github.ref }} + +defaults: + run: + working-directory: go/src/open-cluster-management.io/multicloud-operators-channel + +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/multicloud-operators-channel + - 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/multicloud-operators-channel:latest quay.io/open-cluster-management/multicloud-operators-channel:$RELEASE_VERSION + docker push quay.io/open-cluster-management/multicloud-operators-channel:$RELEASE_VERSION + - name: generate changelog + run: | + echo "# multicloud-operators-channel $RELEASE_VERSION" > /home/runner/work/changelog.txt + echo "- See the [CHANGELOG](https://github.com/open-cluster-management-io/multicloud-operators-channel/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/multicloud-operators-channel:$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 00000000..f257f881 --- /dev/null +++ b/CHANGELOG/CHANGELOG-v0.4.md @@ -0,0 +1,13 @@ +## v0.4.0 + +### New Features +* Initial release, see https://github.com/open-cluster-management-io/multicloud-operators-channel/blob/main/README.md for more details. + +### Added + +### Changes + +### Bug Fixes + +### Removed & Deprecated +N/C From 8b2baf8057b69cf0b0f9e1d338076b2dc7f30a7b Mon Sep 17 00:00:00 2001 From: Mike Ng Date: Thu, 26 Aug 2021 12:41:03 -0400 Subject: [PATCH 2/2] add github action for release Signed-off-by: Mike Ng --- .github/workflows/go-release.yml | 16 ++++++++-------- CHANGELOG/CHANGELOG-v0.4.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index fe03e903..1271dcbb 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -8,12 +8,12 @@ env: # Common versions GO_VERSION: '1.16' GO_REQUIRED_MIN_VERSION: '' - GOPATH: '/home/runner/work/multicloud-operators-channel/multicloud-operators-channel/go' + GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go' GITHUB_REF: ${{ github.ref }} defaults: run: - working-directory: go/src/open-cluster-management.io/multicloud-operators-channel + working-directory: go/src/open-cluster-management.io/multicloud-operators-subscription jobs: release: @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 1 - path: go/src/open-cluster-management.io/multicloud-operators-channel + path: go/src/open-cluster-management.io/multicloud-operators-subscription - name: install Go uses: actions/setup-go@v2 with: @@ -42,13 +42,13 @@ jobs: - 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/multicloud-operators-channel:latest quay.io/open-cluster-management/multicloud-operators-channel:$RELEASE_VERSION - docker push quay.io/open-cluster-management/multicloud-operators-channel:$RELEASE_VERSION + docker tag quay.io/open-cluster-management/multicloud-operators-subscription:latest quay.io/open-cluster-management/multicloud-operators-subscription:$RELEASE_VERSION + docker push quay.io/open-cluster-management/multicloud-operators-subscription:$RELEASE_VERSION - name: generate changelog run: | - echo "# multicloud-operators-channel $RELEASE_VERSION" > /home/runner/work/changelog.txt - echo "- See the [CHANGELOG](https://github.com/open-cluster-management-io/multicloud-operators-channel/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/multicloud-operators-channel:$RELEASE_VERSION" >> /home/runner/work/changelog.txt + echo "# multicloud-operators-subscription $RELEASE_VERSION" > /home/runner/work/changelog.txt + echo "- See the [CHANGELOG](https://github.com/open-cluster-management-io/multicloud-operators-subscription/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/multicloud-operators-subscription:$RELEASE_VERSION" >> /home/runner/work/changelog.txt - name: publish release uses: softprops/action-gh-release@v0.1.5 env: diff --git a/CHANGELOG/CHANGELOG-v0.4.md b/CHANGELOG/CHANGELOG-v0.4.md index f257f881..bb851bc8 100644 --- a/CHANGELOG/CHANGELOG-v0.4.md +++ b/CHANGELOG/CHANGELOG-v0.4.md @@ -1,7 +1,7 @@ ## v0.4.0 ### New Features -* Initial release, see https://github.com/open-cluster-management-io/multicloud-operators-channel/blob/main/README.md for more details. +* Initial release, see https://github.com/open-cluster-management-io/multicloud-operators-subscription/blob/main/README.md for more details. ### Added