Skip to content

Commit 21df1ec

Browse files
build: migrate to changesets
1 parent 8a10809 commit 21df1ec

13 files changed

+919
-71
lines changed

Diff for: .changeset/config.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@fingerprintjs/changesets-changelog-format",
5+
{
6+
"repo": "fingerprintjs/fingerprint-pro-server-api-python-sdk"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "restricted",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": [],
16+
"privatePackages": {
17+
"version": true,
18+
"tag": true
19+
}
20+
}

Diff for: .github/workflows/analyze-commits.yml

+8
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ jobs:
88
analyze-commits:
99
name: Generate docs and coverage report
1010
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1
11+
with:
12+
previewNotes: false
13+
14+
preview-changeset:
15+
name: Preview changeset
16+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/preview-changeset-release.yml@v1
17+
with:
18+
pr-title: ${{ github.event.pull_request.title }}

Diff for: .github/workflows/publish.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Publish'
2+
on:
3+
release:
4+
types:
5+
- published
6+
7+
jobs:
8+
publish:
9+
name: 'Publish to PyPI'
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/fingerprint-pro-server-api-sdk
14+
permissions:
15+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16+
steps:
17+
- name: 'Checkout repository'
18+
uses: actions/checkout@v4
19+
20+
- name: 'Install Python'
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: 'Build'
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
pip install wheel
30+
pip install twine
31+
32+
- name: Publish package distributions to PyPI
33+
uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b
34+
35+

Diff for: .github/workflows/release.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ on:
66
- dev
77

88
jobs:
9-
release-server-sdk-python:
10-
name: 'Publish new version'
11-
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-server-sdk.yml@v1
9+
release:
10+
name: 'Release project'
11+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-sdk-changesets.yml@v1
1212
with:
1313
appId: ${{ vars.APP_ID }}
14+
version-command: bash ./changeset-version.sh
15+
publish-command: bash ./changeset-publish.sh
1416
language: python
1517
language-version: '3.12'
16-
semantic-release-extra-plugins: |
17-
1818
prepare-command: |
1919
python -m pip install --upgrade pip
2020
pip install -r requirements.txt
2121
pip install wheel
2222
pip install twine
2323
secrets:
2424
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
25-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

Diff for: .github/workflows/reset-prerelease-branch.yml

-12
This file was deleted.

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ target/
7070
.DS_Store
7171

7272
.env
73+
node_modules/**

Diff for: .releaserc

-48
This file was deleted.

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Fingerprint Pro Server Python SDK
2+
13
## [7.0.1](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/compare/v7.0.0...v7.0.1) (2024-08-22)
24

35

Diff for: changeset-publish.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
bash ./generate.sh && pnpm exec changeset publish

Diff for: changeset-version.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
pnpm exec changeset version && bash ./generate.sh

Diff for: generate.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION='7.0.1'
3+
VERSION=$(jq -r '.version' package.json)
44

55
while getopts "v:" arg; do
66
case $arg in
@@ -11,10 +11,10 @@ while getopts "v:" arg; do
1111
done
1212

1313
# Make prerelease version compatible with PEP 440
14-
if [[ $VERSION =~ (.*-dev\.)([0-9]+) ]]; then
14+
if [[ $VERSION =~ (.*-test\.)([0-9]+) ]]; then
1515
BASE_VERSION=${BASH_REMATCH[1]}
1616
DEV_NUMBER=${BASH_REMATCH[2]}
17-
VERSION="${BASE_VERSION%-dev.}.dev${DEV_NUMBER}"
17+
VERSION="${BASE_VERSION%-rc.}.rc${DEV_NUMBER}"
1818
fi
1919

2020
# jar was downloaded from here https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.34/
@@ -47,10 +47,8 @@ platform=$(uname)
4747
# Replace version in other files
4848
(
4949
if [ "$platform" = "Darwin" ]; then
50-
sed -i '' "s/^VERSION='[^']*'/VERSION='${VERSION}'/" "./generate.sh"
5150
sed -i '' "s/^VERSION = '[^']*'/VERSION = '${VERSION}'/" "./test/test_fingerprint_api.py"
5251
else
53-
sed -i "s/^VERSION='[^']*'/VERSION='${VERSION}'/" "./generate.sh"
5452
sed -i "s/^VERSION = '[^']*'/VERSION = '${VERSION}'/" "./test/test_fingerprint_api.py"
5553
fi
5654
)

Diff for: package.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "fingerprint-pro-server-api-python-sdk",
3+
"version": "7.0.1",
4+
"private": true,
5+
"devDependencies": {
6+
"@changesets/cli": "^2.27.8",
7+
"@fingerprintjs/changesets-changelog-format": "^0.2.0"
8+
}
9+
}

0 commit comments

Comments
 (0)