Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
wonderix committed Jan 5, 2020
1 parent 96717de commit e971c07
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ jobs:
go-version: 1.13
id: go
- uses: actions/checkout@v1
- name: Build
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: wonderix/shalm
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_names: true
- name: Make chart
run: make chart
- name: Make binaries
run: make binaries
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: shalm-*.tgz
file: bin/shalm-*.tgz
asset_name: "Shalm chart"
tag: ${{ github.ref }}
file_glob: true
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Image URL to use all building/pushing image targets
OS := $(shell uname )
VERSION := $(shell git describe --tags )
VERSION := $(shell git describe --tags --always --dirty)
IMG ?= wonderix/shalm:${VERSION}
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
Expand Down Expand Up @@ -62,7 +62,17 @@ else
sed -i -e 's|version:.*|version: ${VERSION}|g' /tmp/shalm/Chart.yaml
sed -i -e 's|image: wonderix/shalm:.*|image: wonderix/shalm:${VERSION}|g' /tmp/shalm/ytt/deployment.yaml
endif
go run . package /tmp/shalm
mkdir -p bin
cd bin && go run .. package /tmp/shalm

binaries:
mkdir -p bin
cd bin; \
for GOOS in linux darwin windows; do \
CGO_ENABLED=0 GOOS=$$GOOS GOARCH=amd64 GO111MODULE=on go build -o shalm ..; \
tar czf shalm-binary-$$GOOS.tgz shalm; \
done


# find or download controller-gen
# download controller-gen if necessary
Expand Down

0 comments on commit e971c07

Please sign in to comment.