Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from zhiweiyin318/release-job
Browse files Browse the repository at this point in the history
add release action job
  • Loading branch information
openshift-merge-robot authored Jul 21, 2021
2 parents eb89113 + 110a248 commit 26fc7dd
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.1
- name: images
run: make images
- name: push
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin
docker push quay.io/open-cluster-management/placement:latest
2 changes: 1 addition & 1 deletion .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: cluster1
- name: Load image on the nodes of the cluster
run: |
Expand Down
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/placement/placement/go'
GITHUB_REF: ${{ github.ref }}

defaults:
run:
working-directory: go/src/open-cluster-management.io/placement

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/placement
- 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/placement:latest quay.io/open-cluster-management/placement:$RELEASE_VERSION
docker push quay.io/open-cluster-management/placement:$RELEASE_VERSION
- name: generate changelog
run: |
echo "# Placement $RELEASE_VERSION" > /home/runner/work/changelog.txt
echo "- See the [CHANGELOG](https://github.com/open-cluster-management-io/placement/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/placement:$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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ placement
*.so
*.dylib
!vendor/**

.idea
# Test binary, built with `go test -c`
*.test

Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG/CHANGELOG-v0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.

## v0.1.0

### New Features
* Selecting managed clusters with cluster predicates.

### Added
* Init the repo.

### Changes
N/C

### Bug Fixes
N/C

### Removed & Deprecated
N/C

0 comments on commit 26fc7dd

Please sign in to comment.