Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Generate connector capabilities
name: Generate capabilities and config schema

on:
push:
branches:
- main

jobs:
calculate-capabilities:
generate_outputs:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest

steps:
Expand All @@ -18,21 +19,26 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"

- name: Build
run: go build -o connector ./cmd/baton-auth0

- name: Run and save output
- name: Run and save config output
run: ./connector config > config_schema.json

- name: Run and save capabilities output
env:
BATON_AUTH0_BASE_URL: "https://dev-n8a8p1kmt7k0ebdz.us.auth0.com"
BATON_AUTH0_CLIENT_ID: EiajnMCHSnpjNdhAtQZ3SkG2cxE7JGII
BATON_AUTH0_CLIENT_ID: "EiajnMCHSnpjNdhAtQZ3SkG2cxE7JGII"
BATON_AUTH0_CLIENT_SECRET: ${{ secrets.BATON_AUTH0_CLIENT_SECRET }}
run: ./connector capabilities > baton_capabilities.json

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Updating baton capabilities.'
add: 'baton_capabilities.json'
message: "Updating baton config schema and capabilities."
add: |
config_schema.json
baton_capabilities.json
58 changes: 5 additions & 53 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,8 @@ on:
- '*'

jobs:
goreleaser:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Set up Gon
run: brew tap conductorone/gon && brew install conductorone/gon/gon
- name: Import Keychain Certs
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_SIGNING_KEY_P12 }}
p12-password: ${{ secrets.APPLE_SIGNING_KEY_P12_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
goreleaser-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.RELENG_GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean -f .goreleaser.docker.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}
release:
uses: ConductorOne/github-workflows/.github/workflows/release.yaml@v2
with:
tag: ${{ github.ref_name }}
lambda: true
13 changes: 0 additions & 13 deletions .gon-amd64.json

This file was deleted.

13 changes: 0 additions & 13 deletions .gon-arm64.json

This file was deleted.

55 changes: 0 additions & 55 deletions .goreleaser.docker.yaml

This file was deleted.

84 changes: 0 additions & 84 deletions .goreleaser.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM public.ecr.aws/lambda/provided:al2023
ENTRYPOINT ["/baton-auth0", "lambda"]
COPY baton-auth0 /
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
GOOS = $(shell go env GOOS)
GOARCH = $(shell go env GOARCH)
BUILD_DIR = dist/${GOOS}_${GOARCH}
GENERATED_CONF := pkg/config/conf.gen.go

ifeq ($(GOOS),windows)
OUTPUT_PATH = ${BUILD_DIR}/baton-auth0.exe
else
OUTPUT_PATH = ${BUILD_DIR}/baton-auth0
endif

# Set the build tag conditionally based on ENABLE_LAMBDA
ifdef BATON_LAMBDA_SUPPORT
BUILD_TAGS=-tags baton_lambda_support
else
BUILD_TAGS=
endif

.PHONY: build
build:
go build -o ${OUTPUT_PATH} ./cmd/baton-auth0
build: $(GENERATED_CONF)
go build ${BUILD_TAGS} -o ${OUTPUT_PATH} ./cmd/baton-auth0

$(GENERATED_CONF): pkg/config/schema.go go.mod
@echo "Generating $(GENERATED_CONF)..."
go generate ./pkg/config

generate: $(GENERATED_CONF)

.PHONY: update-deps
update-deps:
go get -d -u ./...
go mod tidy -v
go mod vendor

.PHONY: add-dep
add-dep:
.PHONY: add-deps
add-deps:
go mod tidy -v
go mod vendor

Expand Down
2 changes: 1 addition & 1 deletion cmd/baton-auth0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
ctx,
connectorName,
getConnector,
config2.ConfigurationSchema,
config2.Config,
)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
Expand Down
Loading
Loading