Skip to content

Commit

Permalink
Merge pull request #26 from mikeshng/add-githubaction-release
Browse files Browse the repository at this point in the history
Add githubaction release
  • Loading branch information
openshift-merge-robot authored Aug 26, 2021
2 parents 7565edc + 8b2baf8 commit 9425c5d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -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-subscription/multicloud-operators-subscription/go'
GITHUB_REF: ${{ github.ref }}

defaults:
run:
working-directory: go/src/open-cluster-management.io/multicloud-operators-subscription

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-subscription
- 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/[email protected]
- 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-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-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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: /home/runner/work/changelog.txt
13 changes: 13 additions & 0 deletions CHANGELOG/CHANGELOG-v0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## v0.4.0

### New Features
* Initial release, see https://github.com/open-cluster-management-io/multicloud-operators-subscription/blob/main/README.md for more details.

### Added

### Changes

### Bug Fixes

### Removed & Deprecated
N/C

0 comments on commit 9425c5d

Please sign in to comment.