Skip to content
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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
- beta

permissions:
contents: read

jobs:
Install:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -104,6 +107,10 @@ jobs:
Release:
# Prevent infinite release loop
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release)') }}
permissions:
contents: write
issues: write
pull_requests: write
needs:
- Lint
- Typecheck
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Pull Requests
on:
pull_request:

permissions:
contents: read

jobs:
Install:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -97,3 +100,34 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm run build

Release-dry-run:
name: Release (dry-run)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@v4
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: semantic-release --dry-run
run: |
unset GITHUB_ACTIONS
npx semantic-release --dry-run --no-ci --branches "${GITHUB_HEAD_REF}"
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
GIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
GIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
GIT_GIT_COMMITTER_NAME_NAME: ${{ github.event.head_commit.committer.name }}
GIT_GIT_COMMITTER_NAME_EMAIL: ${{ github.event.head_commit.committer.email }}
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
# Beta release tags, e.g. "v3.0.0-beta.1"
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

permissions:
contents: read

jobs:
Install:
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing

Contributing changes to `@s-group/react-usercentrics` is almost fully automated through Git branches and GitHub Actions.

1. Create a new Git branch for your change
1. Commit changes to the branch following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- The commit messages you use will determine the type of new version bump that will be created. See the complete list of release types in the [`@semantic-release/commit-analyzer` default configuration](https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js)
- `feat` commit types will create a _minor_ `0.1.0` bump
- `fix` and `Revert` commit types will create a _patch_ `0.0.1` bump
- Writing `BREAKING CHANGE:` as a prefix in the commit message body, or adding an exclamation mark after any commit type (for example `feat!`) will create a _major_ `1.0.0` bump
1. Push your branch to the GitHub origin, and open a new Pull Request
1. GitHub Actions will automatically run checks against your changes
- You can also see a preview of the upcoming version bump in the checks
1. After the checks have successfully passed, you can merge your Pull Request to the default branch
1. GitHub Actions will automatically create a new version commit, attach a Git tag to it (for example `v3.0.4`), create a GitHub release, and publish the new npm package to the [npmjs.com](https://www.npmjs.com/package/@s-group/react-usercentrics) official registry!
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,7 @@ Useful for rendering custom UI with like listing services' names and description
const services = await getServiceInfo()
const { name, description } = services['my-service-id']
```

## Development

See [CONTRIBUTING.md](./CONTRIBUTING.md).