Skip to content

Commit

Permalink
build: migrate to changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Oct 2, 2024
1 parent 6167944 commit 45d17c1
Show file tree
Hide file tree
Showing 13 changed files with 889 additions and 74 deletions.
20 changes: 20 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@fingerprintjs/changesets-changelog-format",
{
"repo": "fingerprintjs/fingerprint-pro-server-api-php-sdk"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"version": true,
"tag": true
}
}
13 changes: 10 additions & 3 deletions .github/workflows/analyze-commits.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: Analyze Commit Messages
on:
pull_request:
on: [pull_request]

permissions:
pull-requests: write
contents: write
jobs:
analyze-commits:
name: Analyze commits
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1
with:
previewNotes: false

preview-changeset:
name: Preview changeset
uses: fingerprintjs/dx-team-toolkit/.github/workflows/preview-changeset-release.yml@v1
with:
pr-title: ${{ github.event.pull_request.title }}
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ name: 'Release'
on:
push:
branches:
- develop
- main

jobs:
release:
name: 'Publish new version'
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-server-sdk.yml@v1
name: 'Release project'
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-sdk-changesets.yml@v1
with:
appId: ${{ vars.APP_ID }}
version-command: bash ./changeset-version.sh
publish-command: bash ./changeset-publish.sh
language: php
language-version: '8.3'
prepare-command: |
composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist
appId: ${{ vars.APP_ID }}
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
12 changes: 0 additions & 12 deletions .github/workflows/reset-prerelease-branch.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ release/yarn-error.log
release/node_modules
.php-cs-fixer.cache
cov/**/*.*
!cov/**/.gitkeep
!cov/**/.gitkeep
**/node_modules
51 changes: 0 additions & 51 deletions .releaserc.js

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Fingerprint Pro Server PHP SDK

## [5.0.0](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/compare/v4.1.0...v5.0.0) (2024-09-09)


Expand Down
2 changes: 2 additions & 0 deletions changeset-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
bash ./scripts/generate.sh && pnpm exec changeset publish
2 changes: 2 additions & 0 deletions changeset-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
pnpm exec changeset version && bash ./scripts/generate.sh
3 changes: 3 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ Project configuration is described in the `config.json` file. To read about avai
java -jar ./bin/swagger-codegen-cli.jar config-help -l php
```

### How to publish

We use [changesets](https://github.com/changesets/changesets) for handling release notes. If there are relevant changes, please add them to changeset via `pnpm exec changeset`. You need to run `pnpm install` before doing so.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "fingerprint-pro-server-api-php-sdk",
"version": "5.0.0",
"private": true,
"devDependencies": {
"@changesets/cli": "^2.27.8",
"@fingerprintjs/changesets-changelog-format": "^0.2.0"
}
}
Loading

0 comments on commit 45d17c1

Please sign in to comment.