Skip to content

Commit 196e8e6

Browse files
committed
fix
1 parent 270ab25 commit 196e8e6

24 files changed

+473
-142
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bump-minor-pre-major": true,
4+
"versioning": "always-bump-minor",
5+
"group-pull-request-title-pattern": "chore(${branch}): release ${version}",
6+
"packages": {
7+
".": {
8+
"release-type": "simple",
9+
"extra-files": [
10+
{
11+
"type": "generic",
12+
"path": "Makefile"
13+
},
14+
{
15+
"type": "json",
16+
"path": "cli/package.json",
17+
"jsonpath": "$.dependencies['@opentdf/sdk']"
18+
},
19+
{
20+
"type": "json",
21+
"path": "cli/package.json",
22+
"jsonpath": "$.version"
23+
},
24+
{
25+
"type": "json",
26+
"path": "web-app/package.json",
27+
"jsonpath": "$.dependencies['@opentdf/sdk']"
28+
},
29+
{
30+
"type": "json",
31+
"path": "web-app/package.json",
32+
"jsonpath": "$.version"
33+
},
34+
{
35+
"type": "json",
36+
"path": "web-app/package.json",
37+
"jsonpath": "$.scripts.rebuild"
38+
},
39+
{
40+
"type": "generic",
41+
"path": "lib/src/version.ts"
42+
},
43+
{
44+
"type": "json",
45+
"path": "lib/package.json",
46+
"jsonpath": "$.version"
47+
}
48+
]
49+
}
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bump-minor-pre-major": true,
4+
"versioning": "always-bump-patch",
5+
"group-pull-request-title-pattern": "chore(${branch}): release ${version}",
6+
"packages": {
7+
".": {
8+
"release-type": "simple",
9+
"extra-files": [
10+
{
11+
"type": "generic",
12+
"path": "Makefile"
13+
},
14+
{
15+
"type": "json",
16+
"path": "cli/package.json",
17+
"jsonpath": "$.dependencies['@opentdf/sdk']"
18+
},
19+
{
20+
"type": "json",
21+
"path": "cli/package.json",
22+
"jsonpath": "$.version"
23+
},
24+
{
25+
"type": "json",
26+
"path": "web-app/package.json",
27+
"jsonpath": "$.dependencies['@opentdf/sdk']"
28+
},
29+
{
30+
"type": "json",
31+
"path": "web-app/package.json",
32+
"jsonpath": "$.version"
33+
},
34+
{
35+
"type": "json",
36+
"path": "web-app/package.json",
37+
"jsonpath": "$.scripts.rebuild"
38+
},
39+
{
40+
"type": "generic",
41+
"path": "lib/src/version.ts"
42+
},
43+
{
44+
"type": "json",
45+
"path": "lib/package.json",
46+
"jsonpath": "$.version"
47+
}
48+
]
49+
}
50+
}
51+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.3.2"
3+
}

.github/workflows/backport.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Backport merged pull request"
2+
on:
3+
pull_request:
4+
types: [closed]
5+
issue_comment:
6+
types: [created]
7+
8+
# Default empty permissions for all jobs
9+
permissions: {}
10+
11+
jobs:
12+
backport:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
id-token: write
17+
if: |
18+
(
19+
github.event_name == 'pull_request' &&
20+
github.event.pull_request.merged
21+
) || (
22+
github.event_name == 'issue_comment' &&
23+
github.event.issue.pull_request &&
24+
startsWith(github.event.comment.body, '/backport')
25+
)
26+
uses: opentdf/platform/.github/workflows/reusable_backport.yaml@main
27+
secrets:
28+
APP_ID: ${{ secrets.APP_ID }}
29+
AUTOMATION_KEY: ${{ secrets.AUTOMATION_KEY }}

.github/workflows/build.yaml renamed to .github/workflows/build-and-test.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
name: "Build and Test Client"
22

3+
env:
4+
do_sonarscan: >-
5+
${{ (github.event_name == 'push' ||
6+
github.event.pull_request.head.repo.full_name == github.repository) &&
7+
github.actor != 'dependabot[bot]' }}
8+
39
on:
410
pull_request:
511
push:
612
branches:
713
- main
8-
- release/[0-9]+.[0-9]+.[0-9]+
9-
release:
10-
types:
11-
- created
14+
- "release/**"
1215
jobs:
1316
ccc:
1417
runs-on: ubuntu-latest
@@ -235,5 +238,14 @@ jobs:
235238
runs-on: ubuntu-22.04
236239
if: ${{ !cancelled() }}
237240
steps:
238-
- if: contains(needs.*.result, 'failure')
239-
run: echo "Failed due to ${{ contains(needs.*.result, 'failure') }}" && exit 1
241+
242+
- name: "All jobs succeeded"
243+
id: success
244+
if: ${{ contains(needs.*.result, 'success') }}
245+
run: |
246+
:
247+
248+
- name: "One or more jobs failed"
249+
if: ${{ contains(needs.*.result, 'failure') }}
250+
run: |
251+
exit 1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Create Release Branch"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
# Default empty permissions for all jobs
8+
permissions: {}
9+
10+
jobs:
11+
create-release-branch:
12+
if: ${{ endsWith(github.event.release.tag_name, '.0') }}
13+
permissions:
14+
id-token: write
15+
uses: opentdf/platform/.github/workflows/reusable_create-release-branch.yaml@main
16+
secrets:
17+
APP_ID: ${{ secrets.APP_ID }}
18+
AUTOMATION_KEY: ${{ secrets.AUTOMATION_KEY }}

.github/workflows/deliver.yaml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
- release/[0-9]+.[0-9]+.[0-9]+
7+
- "release/**"
88
release:
99
types:
1010
- created
@@ -14,15 +14,17 @@ permissions: {}
1414

1515
jobs:
1616
deliver-ghp:
17+
permissions:
18+
contents: read
19+
packages: write
20+
pages: write
1721
runs-on: ubuntu-latest
18-
outputs:
19-
FULL_VERSION: ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
20-
DIST_TAG: ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
21-
TARGET_VERSION: ${{ steps.check-version.outputs.TARGET_VERSION }}
2222

2323
steps:
2424
- name: "Checkout repo"
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
persist-credentials: false
2628

2729
- name: "Setup node"
2830
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
@@ -49,7 +51,7 @@ jobs:
4951
FULL_VERSION=$(.github/workflows/gh-semver.sh)
5052
DIST_TAG=$(.github/workflows/guess-dist-tag.sh)
5153
52-
echo "FULL_VERSION=FULL_VERSION" >> "$GITHUB_OUTPUT"
54+
echo "FULL_VERSION=$FULL_VERSION" >> "$GITHUB_OUTPUT"
5355
echo "DIST_TAG=$DIST_TAG" >> "$GITHUB_OUTPUT"
5456
5557
- name: "Run: make doc"
@@ -66,7 +68,7 @@ jobs:
6668
as $DIST_TAG \
6769
with version=[$FULL_VERSION]"
6870
69-
- name: "Publish to GitHub Packages"
71+
- name: "Deliver to GitHub Packages"
7072
env:
7173
DIST_TAG: ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
7274
FULL_VERSION: ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
@@ -88,15 +90,17 @@ jobs:
8890
folder: lib/dist/docs
8991

9092
deliver-npmjs:
93+
permissions:
94+
contents: read
9195
runs-on: ubuntu-latest
92-
needs: deliver-ghp
9396
steps:
9497
- name: "Checkout repo"
9598
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99+
with:
100+
persist-credentials: false
96101

97102
- name: "Setup node"
98103
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
99-
100104
with:
101105
node-version: "22"
102106
registry-url: "https://registry.npmjs.org"
@@ -105,20 +109,29 @@ jobs:
105109
run: |
106110
make all
107111
108-
- name: "Publish to npmjs"
112+
- name: "Output build metadata"
113+
id: guess-build-metadata
114+
run: |
115+
FULL_VERSION=$(.github/workflows/gh-semver.sh)
116+
DIST_TAG=$(.github/workflows/guess-dist-tag.sh)
117+
118+
echo "FULL_VERSION=$FULL_VERSION" >> "$GITHUB_OUTPUT"
119+
echo "DIST_TAG=$DIST_TAG" >> "$GITHUB_OUTPUT"
120+
121+
- name: "Deliver to npmjs"
109122
env:
123+
DIST_TAG: ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
124+
FULL_VERSION: ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
110125
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
111-
FULL_VERSION: ${{ needs.deliver-ghp.outputs.FULL_VERSION }}
112-
DIST_TAG: ${{ needs.deliver-ghp.outputs.DIST_TAG }}
113126
run: |
114127
bash scripts/deliver-to-npm-registry.sh "$FULL_VERSION" "$DIST_TAG"
115128
116129
- name: "Echo info to Run Summary"
117130
env:
118-
FULL_VERSION: ${{ needs.deliver-ghp.outputs.FULL_VERSION }}
131+
FULL_VERSION: ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
119132
run: |
120133
{
121134
echo "- [Client Library](https://www.npmjs.com/package/@opentdf/sdk/v/$FULL_VERSION)"
122-
echo "- [Command Line Tool](https://www.npmjs.com/package/@opentdf/ctl/v/FULL_VERSION)"
135+
echo "- [Command Line Tool](https://www.npmjs.com/package/@opentdf/ctl/v/$FULL_VERSION)"
123136
echo "- [unpkg](https://unpkg.com/browse/@opentdf/sdk@$FULL_VERSION)"
124137
} >>"$GITHUB_STEP_SUMMARY"

.github/workflows/release.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: "Release"
1+
name: Release
22

33
on:
4-
workflow_call: {}
54
push:
65
branches:
76
- main
8-
- "release/*"
7+
- "release/**"
98

10-
# Default empty permissions for all jobs
119
permissions: {}
1210

1311
jobs:
@@ -16,3 +14,36 @@ jobs:
1614
contents: write
1715
pull-requests: write
1816
uses: opentdf/platform/.github/workflows/reusable_release-please.yaml@main
17+
secrets:
18+
APP_ID: ${{ secrets.APP_ID }}
19+
AUTOMATION_KEY: ${{ secrets.AUTOMATION_KEY }}
20+
21+
update-dependencies:
22+
if: ${{ needs.release-please.outputs.prs_created == 'true' }}
23+
needs: release-please
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
steps:
29+
- name: "Generate a token"
30+
id: generate-token
31+
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
32+
with:
33+
app-id: ${{ secrets.APP_ID }}
34+
private-key: ${{ secrets.AUTOMATION_KEY }}
35+
36+
- name: "Checkout repo"
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
persist-credentials: true
40+
ref: ${{ fromJSON(needs.release-please.outputs.prs)[0].headBranchName }}
41+
42+
- name: "Update dependencies"
43+
run: |
44+
git config --global user.name "opentdf-automation[bot]"
45+
git config --global user.email "149537512+opentdf-automation[bot]@users.noreply.github.com"
46+
make all
47+
git add .
48+
git commit -m "Update dependencies"
49+
git push

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

2+
# x-release-please-start-version
23
version=0.3.2
4+
# x-release-please-end
35
extras=cli web-app
46
pkgs=lib $(extras)
57

0 commit comments

Comments
 (0)