Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babbel/publish-build-metadata
Collects build artifacts metadata and publishes them to DynamoDB
https://github.com/babbel/publish-build-metadata
actions
Last synced: about 1 month ago
JSON representation
Collects build artifacts metadata and publishes them to DynamoDB
- Host: GitHub
- URL: https://github.com/babbel/publish-build-metadata
- Owner: babbel
- License: mit
- Created: 2021-05-06T10:11:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T10:52:12.000Z (9 months ago)
- Last Synced: 2024-04-22T12:02:30.362Z (9 months ago)
- Topics: actions
- Language: JavaScript
- Homepage:
- Size: 2.05 MB
- Stars: 1
- Watchers: 39
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# publish-build-metadata
Internal Babbel tool to collect build artifacts metadata.
## Usage
In your project workflow, after build artifact was published.
All `AWS_` secrets should be already set and ready to use.
### Standalone project example
```yaml
permissions:
contents: read
id-token: writejobs:
name_of_the_job:
#
# ...
#
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
#
# ... build & publish the artifact
#
- uses: babbel/publish-build-metadata@v1
with:
meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}
```### Microverse example, all slices at once
```yaml
permissions:
contents: read
id-token: writejobs:
name_of_the_job:
#
# ...
#
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
#
# ... build & publish the artifact
#
- uses: babbel/publish-build-metadata@v1
with:
meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}
slices: 'api, consumer.kinesis, consumer.firehose'
```### Microverse example, one slice at a time
For example in case you have jobs matrix.
```yaml
permissions:
contents: read
id-token: writejobs:
name_of_the_job:
#
# ...
#
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
#
# ... build & publish the artifact
#
- uses: babbel/publish-build-metadata@v1
with:
meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}
slices: 'api' # or ${{ matrix.function_name }}
```### When custom Commit SHA
Sometimes you might trigger an automatic build which fetches a different branch. In such case `GITHUB_SHA` differs from actual Commit SHA that the build is working on.
In such case you can override `GITHUB_SHA` by passing extra parameter:
```yaml
permissions:
contents: read
id-token: writejobs:
name_of_the_job:
#
# ...
#
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
#
# ... build & publish the artifact
#
- uses: babbel/publish-build-metadata@v1
with:
meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}
sha: ${{ env.MY_CUSTOM_COMMIT_SHA }}
```Usually with above it will be handy to be able to specify the branch name as well, so the full example would look like:
```yaml
permissions:
contents: read
id-token: writejobs:
name_of_the_job:
#
# ...
#
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
#
# ... build & publish the artifact
#
- uses: babbel/publish-build-metadata@v1
with:
meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}
sha: ${{ env.MY_CUSTOM_COMMIT_SHA }}
branch: ${{ env.MY_CUSTOM_BRANCH }}
```## Contribute
Prep the project, it runs against nodejs v20, when using `asdf-vm` just hit `asdf install`. Then install the packages
```
npm ci
```Run the tests
```
make test
```Or better run the whole build all the time, this way you won't forget to run it before commit
```
make build
```