diff --git a/.github/workflows/push_main.yaml b/.github/workflows/ci.yaml similarity index 65% rename from .github/workflows/push_main.yaml rename to .github/workflows/ci.yaml index 1b97527..84fcec7 100644 --- a/.github/workflows/push_main.yaml +++ b/.github/workflows/ci.yaml @@ -8,10 +8,16 @@ name: Push (main) on: push: branches: - - main + - "main" + - "release-**" + tags: + - "v**" paths: - "rockcraft.yaml" - ".github/workflows/**.yaml" + pull_request: + branches: + - "*" workflow_dispatch: jobs: @@ -19,9 +25,11 @@ jobs: uses: ./.github/workflows/build.yaml publish: + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: build uses: ./.github/workflows/publish.yaml scan: + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: publish uses: ./.github/workflows/scan.yaml diff --git a/.github/workflows/push_any.yaml b/.github/workflows/push_any.yaml deleted file mode 100644 index 6e80374..0000000 --- a/.github/workflows/push_any.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Push (any) - -# When pushing to any branch other than "main", we: -# * build the rock image - -on: - push: - branches-ignore: - - "main" - paths: - - "rockcraft.yaml" - - ".github/workflows/**.yaml" - -jobs: - build: - uses: ./.github/workflows/build.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..bed15f6 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# OpenFGA ROCK + +[![Release](https://github.com/canonical/openfga-rock/actions/workflows/ci.yaml/badge.svg)](https://github.com/canonical/openfga-rock/actions/workflows/ci.yaml) +[![Container Registry](https://img.shields.io/badge/Container%20Registry-published-blue)](https://github.com/canonical/openfga-rock/pkgs/container/openfga) + + +This repository contains the packaging metadata for creating an OpenFGA ROCK built from Canonical OpenFGA release artifacts. For more information on ROCKs, visit the [rockcraft Github](https://github.com/canonical/rockcraft). + + + +## Building the ROCK +The steps outlined below are based on the assumption that you are building the ROCK with the latest LTS of Ubuntu. If you are using another version of Ubuntu or another operating system, the process may be different. + +### Clone Repository +```bash +git clone git@github.com:canonical/openfga-rock.git +cd openfga-rock +``` + +### Installing Prerequisites +```bash +sudo snap install rockcraft --edge +sudo snap install docker +sudo snap install lxd +sudo snap install skopeo --edge --devmode +``` + +### Configuring Prerequisites +```bash +sudo usermod -aG docker $USER +sudo lxd init --auto +``` +*_NOTE:_* You will need to open a new shell for the group change to take effect (i.e. `su - $USER`) + + +### Packing and Running the ROCK +```bash +rockcraft pack +skopeo --insecure-policy copy oci-archive:openfga*.rock docker-daemon:/openfga: +docker run --rm -it /openfga: +``` + +## License +The OpenFGA ROCK is free software, distributed under the Apache +Software License, version 2.0. See +[LICENSE](https://github.com/canonical/zookeeper-rock/blob/3.6/stable/LICENSE) +for more information. \ No newline at end of file diff --git a/rockcraft.yaml b/rockcraft.yaml index cfa690d..e24c705 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -1,7 +1,7 @@ name: openfga base: bare build-base: ubuntu@22.04 -version: "1.3.9" +version: "1.5.2" summary: Openfga Authorization Server description: | OpenFGA is a flexible Authorization system inspired by Google's Zanzibar, designed for reliability and low latency at scale. @@ -46,7 +46,7 @@ parts: - CGO_ENABLED: 0 source: https://github.com/openfga/openfga source-type: git - source-tag: v1.3.9 + source-tag: v1.5.2 override-build: | src_config_path="github.com/openfga/openfga/internal" build_ver="${src_config_path}/build.Version"