Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [INTEG-2065] - Configure build and packaging #2

Merged
merged 7 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .contentful/vault-secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 1
services:
github-action:
policies:
- dependabot
- packages-read
- semantic-release
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# team integrations owns all code in this repository by default
* @contentful/team-integrations
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Purpose

<!-- Why are we introducing this component? What is the story/background for it? -->

## Description

<!--What does this component do? Where is the component expected to be used outside of this component library? -->

## Testing steps

<!-- Where can the user find this component to test its functionality? -->

## Breaking Changes

<!-- Are there any changes to be aware of that would break current production build? -->

## Design, Documentation, and/or References

<!-- What original designs are associated with this component? Where can we get more insights about this change? (Tickets, wiki pages or links to other places/docs -- no private/internal links please) -->

## Deployment

<!-- (Optional) Are there any deployment-related tasks, concerns or risks we should be mindful of? -->
73 changes: 73 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Node.js Package

on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize]
branches: ['main']

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build-job:
permissions:
contents: read
id-token: write

release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Retrieve NPM Token"
id: vault
uses: hashicorp/vault-action@v2.4.3
with:
url: ${{ secrets.VAULT_URL }}
role: ${{ github.event.repository.name }}-github-action
method: jwt
path: github-actions
exportEnv: false
secrets: |
secret/data/github/github_packages_read GITHUB_PACKAGES_READ_TOKEN | GITHUB_PACKAGES_READ_TOKEN ;

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@contentful'
always-auth: true

- name: "Create NPM .npmrc"
shell: bash
run: |
echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_READ_TOKEN}" > ~/.npmrc
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
env:
GITHUB_PACKAGES_READ_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_READ_TOKEN }}

- run: npm ci
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_READ_TOKEN }}

- run: npm run build
- run: npm test

- run: |
npx semantic-release
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v19.6.0
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
build/
.coverage/
.cache/
11 changes: 11 additions & 0 deletions catalog-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: vercel-toolkit
annotations:
github.com/project-slug: contentful/vercel-toolkit

spec:
type: library
lifecycle: production
owner: group:team-integrations
Loading