Skip to content

Commit

Permalink
ci: add release-please config for api-js (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld authored Nov 7, 2024
1 parent ec82b2a commit b7c6722
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ runs:
- name: Build JS API
shell: bash
run: |
cd api/sdkmeta-js && npm install && npx publint
cd api-js && npm install && npx publint
- name: Test JS API
shell: bash
run: |
cd api/sdkmeta-js && npm test
cd api-js && npm test
- name: Sanity test ingestion
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/publish-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ runs:
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry_run }}
shell: bash
run: |
cd api/sdkmeta-js
cd api-js
./scripts/publish.sh
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@ on:
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
package-api-js-released: ${{ steps.release.outputs['api-js--release_created'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}

release-npm:
runs-on: ubuntu-latest
needs: release-please
permissions:
id-token: write
contents: write
if: ${{ needs.release-please.outputs.package-api-js-released == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/publish-npm
with:
prerelease: true
dry_run: false
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"api": "0.3.2"
"api": "0.3.2",
"api-js": "0.0.4"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"release-type" : "go",
"tag-separator": "/",
"versioning" : "default"
},
"api-js" : {
"package-name": "api-js",
"release-type" : "node",
"tag-separator": "/",
"versioning" : "default"
}
}
}
4 changes: 2 additions & 2 deletions scripts/generate-products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
# Cleanup existing products so we have a clean slate.
rm products/*.json
rm api/sdkmeta/data/*.json
rm api/sdkmeta-js/src/data/*.json
rm api-js/src/data/*.json

sqlite3 -json metadata.sqlite3 "SELECT * from sdk_languages;" |
jq -S 'reduce .[] as $item ({}; .[$item.id] += [$item.language])' > products/languages.json
Expand Down Expand Up @@ -40,4 +40,4 @@ sqlite3 -json metadata.sqlite3 "SELECT * from sdk_popularity;" |
cp products/*.json api/sdkmeta/data/

# Same for the Typescript module.
cp products/*.json api/sdkmeta-js/src/data/
cp products/*.json api-js/src/data/

0 comments on commit b7c6722

Please sign in to comment.