Skip to content

Commit ead2622

Browse files
committed
fix: standardize GitHub workflows
1 parent 4215a0a commit ead2622

File tree

3 files changed

+106
-75
lines changed

3 files changed

+106
-75
lines changed

.github/workflows/on-pr.yaml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,54 @@
1-
name: PR Validation
1+
name: on-pr
22

33
on:
44
pull_request:
55
branches:
66
- main
7+
types:
8+
- labeled
9+
- opened
10+
- reopened
11+
- synchronize
12+
paths:
13+
- '.github/workflows/on-pr.yaml'
14+
- '.gitops/**'
15+
- 'apis/**'
16+
- 'examples/**'
17+
- 'tests/**'
18+
- 'functions/**'
19+
- 'upbound.yaml'
20+
21+
permissions:
22+
packages: write
23+
contents: write
24+
issues: write
25+
pull-requests: write
26+
id-token: write
727

828
jobs:
929
validate:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v4
13-
- uses: unbounded-tech/actions/crossplane-validate@main
14-
with:
15-
examples: |
16-
examples/mongodboperators/minimal.yaml::
17-
examples/mongodboperators/standard.yaml::
30+
uses: unbounded-tech/workflows-crossplane/.github/workflows/validate.yaml@v2.13.0
31+
with:
32+
examples: |
33+
[
34+
{ "example": "examples/mongodboperators/minimal.yaml" },
35+
{ "example": "examples/mongodboperators/standard.yaml" }
36+
]
37+
api_path: apis/mongodboperators
38+
error_on_missing_schemas: true
1839

1940
test:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
- uses: unbounded-tech/actions/crossplane-test@main
41+
uses: unbounded-tech/workflows-crossplane/.github/workflows/test.yaml@v2.13.0
2442

2543
e2e:
26-
runs-on: ubuntu-latest
27-
permissions:
28-
contents: read
29-
id-token: write
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: unbounded-tech/actions/crossplane-e2e@main
33-
with:
34-
aws-use-oidc: true
35-
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
36-
aws-region: us-east-1
44+
uses: unbounded-tech/workflows-crossplane/.github/workflows/e2e.yaml@v2.13.0
3745

3846
publish:
39-
needs: [validate, test]
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v4
43-
- uses: unbounded-tech/actions/crossplane-publish@main
44-
with:
45-
tag: 0.0.0-pr${{ github.event.pull_request.number }}
46-
ghcr-token: ${{ secrets.GHCR_TOKEN }}
47+
needs:
48+
- validate
49+
- test
50+
- e2e
51+
uses: unbounded-tech/workflows-crossplane/.github/workflows/publish.yaml@v2.13.0
52+
secrets: inherit
53+
with:
54+
tag: pr-${{ github.event.pull_request.number }}-${{ github.sha }}
Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,60 @@
1-
name: Main Branch CI
1+
name: on-push-main
22

33
on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- '.github/workflows/on-push-main.yaml'
9+
- '.github/workflows/on-version-tagged.yaml'
10+
- '.gitops/**'
11+
- 'apis/**'
12+
- 'examples/**'
13+
- 'functions/**'
14+
- 'tests/**'
15+
- 'upbound.yaml'
16+
17+
permissions:
18+
packages: write
19+
contents: write
20+
issues: write
21+
pull-requests: write
22+
id-token: write
723

824
jobs:
925
validate:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v4
13-
- uses: unbounded-tech/actions/crossplane-validate@main
14-
with:
15-
examples: |
16-
examples/mongodboperators/minimal.yaml::
17-
examples/mongodboperators/standard.yaml::
26+
uses: unbounded-tech/workflows-crossplane/.github/workflows/validate.yaml@v2.13.0
27+
with:
28+
examples: |
29+
[
30+
{ "example": "examples/mongodboperators/minimal.yaml" },
31+
{ "example": "examples/mongodboperators/standard.yaml" }
32+
]
33+
api_path: apis/mongodboperators
34+
error_on_missing_schemas: true
1835

1936
test:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
- uses: unbounded-tech/actions/crossplane-test@main
37+
uses: unbounded-tech/workflows-crossplane/.github/workflows/test.yaml@v2.13.0
2438

2539
e2e:
26-
runs-on: ubuntu-latest
27-
permissions:
28-
contents: read
29-
id-token: write
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: unbounded-tech/actions/crossplane-e2e@main
33-
with:
34-
aws-use-oidc: true
35-
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
36-
aws-region: us-east-1
40+
uses: unbounded-tech/workflows-crossplane/.github/workflows/e2e.yaml@v2.13.0
3741

3842
version-and-tag:
39-
needs: [validate, test, e2e]
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v4
43-
with:
44-
fetch-depth: 0
45-
- uses: unbounded-tech/actions/version-and-tag@main
46-
with:
47-
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
name: Version and Tag
44+
needs:
45+
- validate
46+
- test
47+
- e2e
48+
uses: unbounded-tech/workflow-vnext-tag/.github/workflows/workflow.yaml@v1.20.2
49+
secrets:
50+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
51+
with:
52+
useDeployKey: true
53+
yqPatches: |
54+
patches:
55+
- filePath: .gitops/deploy/values.yaml
56+
selector: .version
57+
valuePrefix: "v"
58+
- filePath: .gitops/deploy/Chart.yaml
59+
selector: .version
60+
valuePrefix: ""
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
name: Release
2-
1+
name: promote
32
on:
43
push:
54
tags:
6-
- 'v*'
5+
- v*.*.*
6+
7+
permissions:
8+
packages: write
9+
contents: write
10+
issues: write
11+
pull-requests: write
712

813
jobs:
14+
915
publish:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v4
13-
- uses: unbounded-tech/actions/crossplane-publish@main
14-
with:
15-
tag: ${{ github.ref_name }}
16-
ghcr-token: ${{ secrets.GHCR_TOKEN }}
16+
uses: unbounded-tech/workflows-crossplane/.github/workflows/publish.yaml@v2.13.0
17+
secrets: inherit
18+
with:
19+
tag: ${{ github.ref_name }}
20+
21+
release:
22+
needs: publish
23+
uses: unbounded-tech/workflow-simple-release/.github/workflows/workflow.yaml@v2.1.1
24+
with:
25+
tag: ${{ github.ref_name }}
26+
name: ${{ github.ref_name }}

0 commit comments

Comments
 (0)