File tree Expand file tree Collapse file tree 12 files changed +163
-242
lines changed
Expand file tree Collapse file tree 12 files changed +163
-242
lines changed Original file line number Diff line number Diff line change 1- name : Generate connector capabilities
1+ name : Generate capabilities and config schema
22
33on :
44 push :
55 branches :
66 - main
77
88jobs :
9- calculate-capabilities :
9+ generate_outputs :
10+ if : github.actor != 'github-actions[bot]'
1011 runs-on : ubuntu-latest
1112
1213 steps :
@@ -18,21 +19,26 @@ jobs:
1819 - name : Setup Go
1920 uses : actions/setup-go@v5
2021 with :
21- go-version-file : ' go.mod'
22+ go-version-file : " go.mod"
2223
2324 - name : Build
2425 run : go build -o connector ./cmd/baton-auth0
2526
26- - name : Run and save output
27+ - name : Run and save config output
28+ run : ./connector config > config_schema.json
29+
30+ - name : Run and save capabilities output
2731 env :
2832 BATON_AUTH0_BASE_URL : " https://dev-n8a8p1kmt7k0ebdz.us.auth0.com"
29- BATON_AUTH0_CLIENT_ID : EiajnMCHSnpjNdhAtQZ3SkG2cxE7JGII
33+ BATON_AUTH0_CLIENT_ID : " EiajnMCHSnpjNdhAtQZ3SkG2cxE7JGII"
3034 BATON_AUTH0_CLIENT_SECRET : ${{ secrets.BATON_AUTH0_CLIENT_SECRET }}
3135 run : ./connector capabilities > baton_capabilities.json
3236
3337 - name : Commit changes
3438 uses : EndBug/add-and-commit@v9
3539 with :
3640 default_author : github_actions
37- message : ' Updating baton capabilities.'
38- add : ' baton_capabilities.json'
41+ message : " Updating baton config schema and capabilities."
42+ add : |
43+ config_schema.json
44+ baton_capabilities.json
Original file line number Diff line number Diff line change 66 - ' *'
77
88jobs :
9- goreleaser :
10- runs-on : macos-latest
11- steps :
12- - name : Checkout
13- uses : actions/checkout@v4
14- with :
15- fetch-depth : 0
16- - name : Set up Go
17- uses : actions/setup-go@v5
18- with :
19- go-version : 1.22.x
20- - name : Set up Gon
21- run : brew tap conductorone/gon && brew install conductorone/gon/gon
22- - name : Import Keychain Certs
23- uses : apple-actions/import-codesign-certs@v1
24- with :
25- p12-file-base64 : ${{ secrets.APPLE_SIGNING_KEY_P12 }}
26- p12-password : ${{ secrets.APPLE_SIGNING_KEY_P12_PASSWORD }}
27- - name : Run GoReleaser
28- uses : goreleaser/goreleaser-action@v6
29- with :
30- version : " ~> v2"
31- args : release --clean
32- env :
33- GITHUB_TOKEN : ${{ secrets.RELENG_GITHUB_TOKEN }}
34- AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
35- AC_PROVIDER : ${{ secrets.AC_PROVIDER }}
36- goreleaser-docker :
37- runs-on : ubuntu-latest
38- steps :
39- - name : Checkout
40- uses : actions/checkout@v4
41- with :
42- fetch-depth : 0
43- - name : Set up Go
44- uses : actions/setup-go@v5
45- with :
46- go-version : 1.22.x
47- - name : Docker Login
48- uses : docker/login-action@v1
49- with :
50- registry : ghcr.io
51- username : ${{ github.repository_owner }}
52- password : ${{ secrets.RELENG_GITHUB_TOKEN }}
53- - name : Set up Docker Buildx
54- uses : docker/setup-buildx-action@v1
55- - name : Run GoReleaser
56- uses : goreleaser/goreleaser-action@v6
57- with :
58- version : " ~> v2"
59- args : release --clean -f .goreleaser.docker.yaml
60- env :
61- GITHUB_TOKEN : ${{ secrets.RELENG_GITHUB_TOKEN }}
9+ release :
10+ uses : ConductorOne/github-workflows/.github/workflows/release.yaml@v2
11+ with :
12+ tag : ${{ github.ref_name }}
13+ lambda : true
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ FROM public.ecr.aws/lambda/provided:al2023
2+ ENTRYPOINT ["/baton-auth0", "lambda"]
3+ COPY baton-auth0 /
Original file line number Diff line number Diff line change 11GOOS = $(shell go env GOOS)
22GOARCH = $(shell go env GOARCH)
33BUILD_DIR = dist/${GOOS}_${GOARCH}
4+ GENERATED_CONF := pkg/config/conf.gen.go
45
56ifeq ($(GOOS ) ,windows)
67OUTPUT_PATH = ${BUILD_DIR}/baton-auth0.exe
78else
89OUTPUT_PATH = ${BUILD_DIR}/baton-auth0
910endif
1011
12+ # Set the build tag conditionally based on ENABLE_LAMBDA
13+ ifdef BATON_LAMBDA_SUPPORT
14+ BUILD_TAGS=-tags baton_lambda_support
15+ else
16+ BUILD_TAGS=
17+ endif
18+
1119.PHONY : build
12- build :
13- go build -o ${OUTPUT_PATH} ./cmd/baton-auth0
20+ build : $(GENERATED_CONF )
21+ go build ${BUILD_TAGS} -o ${OUTPUT_PATH} ./cmd/baton-auth0
22+
23+ $(GENERATED_CONF ) : pkg/config/schema.go go.mod
24+ @echo " Generating $( GENERATED_CONF) ..."
25+ go generate ./pkg/config
26+
27+ generate : $(GENERATED_CONF )
1428
1529.PHONY : update-deps
1630update-deps :
1731 go get -d -u ./...
1832 go mod tidy -v
1933 go mod vendor
2034
21- .PHONY : add-dep
22- add-dep :
35+ .PHONY : add-deps
36+ add-deps :
2337 go mod tidy -v
2438 go mod vendor
2539
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func main() {
2727 ctx ,
2828 connectorName ,
2929 getConnector ,
30- config2 .ConfigurationSchema ,
30+ config2 .Config ,
3131 )
3232 if err != nil {
3333 fmt .Fprintln (os .Stderr , err .Error ())
You can’t perform that action at this time.
0 commit comments