Skip to content

Commit

Permalink
chore: add release workflow (#750)
Browse files Browse the repository at this point in the history
* Regenerate deepcopy

* Add the workflow

* Stop signing the tag
  • Loading branch information
Sig00rd authored Jun 21, 2022
1 parent 8fee7f2 commit 63e96c9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release Operator
on:
workflow_dispatch:

jobs:
build-and-release:
name: Release Operator, build and push newest image
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up env vars
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV
- name: Prepare go environment
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Ensure Golang runtime dependencies
run: make go-dependencies

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Tag the release
run: make tag

- name: Set version for release tag name
run: |
echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push the image to DockerHub
run: |
git reset --hard
make container-runtime-release
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat
.PHONY: tag
tag: ## Create a new git tag to prepare to build a release
@echo "+ $@"
git tag -s -a $(VERSION) -m "$(VERSION)"
git tag -a $(VERSION) -m "$(VERSION)"
git push origin $(VERSION)

.PHONY: help
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 63e96c9

Please sign in to comment.