Skip to content

Commit 3b02a9c

Browse files
authored
Merge pull request #9 from openfga/release_action
chore: adds release action.
2 parents c2adc4f + 24dff95 commit 3b02a9c

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

.github/workflows/release.yaml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- ".github/workflows/release.yaml"
9+
10+
workflow_dispatch:
11+
inputs:
12+
branch:
13+
description: 'Branch to run the workflow on'
14+
required: true
15+
default: 'main'
16+
17+
jobs:
18+
build-and-release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.inputs.branch }}
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: 1.22.1
30+
31+
- name: Build
32+
run: make build
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Login to GHCR
41+
uses: docker/login-action@v2
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Build and push
48+
id: push
49+
uses: docker/build-push-action@v5
50+
with:
51+
context: extauthz
52+
platforms: linux/amd64,linux/arm64
53+
push: ${{ github.event_name != 'pull_request' }}
54+
tags: openfga/openfga-envoy:${{ github.event.inputs.branch || 'dev' }}
55+
56+
- name: Write summary
57+
if: ${{ github.event_name != 'pull_request' }}
58+
run: |
59+
echo "The image is available:" >> $GITHUB_STEP_SUMMARY
60+
echo "```" >> $GITHUB_STEP_SUMMARY
61+
echo "docker pull ghcr.io/openfga/openfga-envoy:${{ github.event.inputs.branch }}@${{ steps.push.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
62+
echo "```" >> $GITHUB_STEP_SUMMARY

extauthz/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
OPENFGA_EXTAUTHZ_VERSION ?= dev
2+
13
.PHONY: test
24
test:
35
@go test -count=1 ./...
@@ -9,7 +11,7 @@ build:
911

1012
.PHONY: docker
1113
docker: build
12-
@docker build -t envoy-extauthz -f Dockerfile .
14+
@docker build -t gcr.io/openfga/openfga-extauthz:$(OPENFGA_EXTAUTHZ_VERSION) -f Dockerfile .
1315

1416
.PHONY: e2e
1517
e2e:

0 commit comments

Comments
 (0)