Skip to content

Commit

Permalink
add release step to push examples (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
EItanya authored Dec 7, 2021
1 parent 09ebe1a commit 548b90d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
TAGGED_VERSION: ${{ github.event.release.tag_name }}

build-and-push-image:
push-builder-images:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -62,5 +62,48 @@ jobs:
password: ${{ secrets.PUSH_TOKEN }}
- name: Push Docker Container
run: make docker-push
env:
TAGGED_VERSION: ${{ github.event.release.tag_name }}

push-example-programs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17.3
- name: Setup Cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PUSH_TOKEN }}

- name: Build builder container
run: make docker-build
env:
TAGGED_VERSION: ${{ github.event.release.tag_name }}

- name: Build CLI
run: make bee-linux-amd64
env:
TAGGED_VERSION: ${{ github.event.release.tag_name }}

- name: Push example images
run: make release-examples -B
env:
TAGGED_VERSION: ${{ github.event.release.tag_name }}
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#----------------------------------------------------------------------------------
OUTDIR?=_output
HUB?=ghcr.io/solo-io
REPO_NAME?=bumblebee
EXAMPLES_DIR?=examples


RELEASE := "true"
Expand All @@ -19,6 +21,11 @@ GCFLAGS := all="-N -l"

SOURCES := $(shell find . -name "*.go" | grep -v test.go)

.PHONY: clean
clean:
rm -f $(EXAMPLES_DIR)/**/*.o
rm -rf $(OUTDIR)

#----------------------------------------------------------------------------------
# Build Container
#----------------------------------------------------------------------------------
Expand All @@ -35,6 +42,23 @@ docker-push: DOCKER=docker buildx
docker-push: PLATFORMS=linux/amd64,linux/arm64/v8
docker-push: docker-build

#----------------------------------------------------------------------------------
# Examples
#----------------------------------------------------------------------------------

.PHONY: activeconn
activeconn: $(EXAMPLES_DIR)/activeconn
.PHONY: tcpconnect
tcpconnect: $(EXAMPLES_DIR)/tcpconnect


$(EXAMPLES_DIR)/%:
$(OUTDIR)/bee-linux-amd64 build $@/$*.c $(HUB)/$(REPO_NAME)/$*:$(VERSION)
$(OUTDIR)/bee-linux-amd64 push $(HUB)/$(REPO_NAME)/$*:$(VERSION)

.PHONY: release-examples
release-examples: activeconn tcpconnect

#----------------------------------------------------------------------------------
# CLI
#----------------------------------------------------------------------------------
Expand Down

0 comments on commit 548b90d

Please sign in to comment.