Skip to content

Commit 35297e3

Browse files
committed
ci: Replace releaser with release please
1 parent 57ca6ac commit 35297e3

File tree

14 files changed

+269
-240
lines changed

14 files changed

+269
-240
lines changed

.circleci/config.yml

Lines changed: 0 additions & 172 deletions
This file was deleted.

.github/actions/publish/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Package
2+
description: 'Publish the package to PyPI'
3+
inputs:
4+
token:
5+
description: 'Token to use for publishing.'
6+
required: true
7+
dry_run:
8+
description: 'Is this a dry run. If so no package will be published.'
9+
required: true
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- name: Set up Python 3.11
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.11
18+
19+
- name: Install dependencies
20+
shell: bash
21+
run: |
22+
pip install -r requirements.txt
23+
pip install wheel
24+
pip install setuptools
25+
26+
- name: Building publishable packages
27+
shell: bash
28+
run: python setup.py sdist bdist_wheel
29+
30+
- name: Publish package distributions to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
if: ${{ inputs.dry_run == 'false' }}
33+
with:
34+
password: ${{inputs.token}}

.github/workflows/ci.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Quality control checks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md' # Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [ main ]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
linux:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
21+
services:
22+
redis:
23+
image: redis
24+
ports:
25+
- 6379:6379
26+
dynamodb:
27+
image: amazon/dynamodb-local
28+
ports:
29+
- 8000:8000
30+
consul:
31+
image: hashicorp/consul
32+
ports:
33+
- 8500:8500
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
42+
- name: Install requirements
43+
run: |
44+
pipx install virtualenv
45+
pip install setuptools
46+
pip install -r test-requirements.txt
47+
pip install -r test-filesource-optional-requirements.txt
48+
pip install -r consul-requirements.txt
49+
python setup.py install
50+
pip freeze
51+
52+
- name: Run tests
53+
run: pytest -s testing -W error::SyntaxWarning
54+
55+
- name: Test packaging
56+
run: |
57+
sudo rm -rf dist *.egg-info
58+
./test-packaging/test-packaging.sh
59+
60+
- name: Verify typehints
61+
run: make lint
62+
63+
- name: Verify docs can be successfully built
64+
run: make docs
65+
66+
- name: Build contract tests
67+
run: make build-contract-tests
68+
69+
- name: Start contract test service
70+
run: make start-contract-test-service &
71+
72+
- name: run contract tests
73+
run: make run-contract-tests
74+
75+
windows:
76+
runs-on: windows-latest
77+
78+
defaults:
79+
run:
80+
shell: powershell
81+
82+
strategy:
83+
matrix:
84+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
85+
86+
steps:
87+
- uses: actions/checkout@v4
88+
- name: Set up Python ${{ matrix.python-version }}
89+
uses: actions/setup-python@v4
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
93+
- name: Setup DynamoDB
94+
run: |
95+
$ProgressPreference = "SilentlyContinue"
96+
iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip
97+
mkdir dynamo
98+
Expand-Archive -Path dynamo.zip -DestinationPath dynamo
99+
cd dynamo
100+
cmd /c "START /b java -Djava.library.path=./DynamoDBLocal_lib -jar ./DynamoDBLocal.jar"
101+
102+
- name: Setup Consul
103+
run: |
104+
$ProgressPreference = "SilentlyContinue"
105+
iwr -outf consul.zip https://releases.hashicorp.com/consul/1.4.2/consul_1.4.2_windows_amd64.zip
106+
mkdir consul
107+
Expand-Archive -Path consul.zip -DestinationPath consul
108+
cd consul
109+
sc.exe create "Consul" binPath="$(Get-Location)/consul.exe agent -dev"
110+
sc.exe start "Consul"
111+
112+
- name: Setup Redis
113+
run: |
114+
$ProgressPreference = "SilentlyContinue"
115+
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
116+
mkdir redis
117+
Expand-Archive -Path redis.zip -DestinationPath redis
118+
cd redis
119+
./redis-server --service-install
120+
./redis-server --service-start
121+
Start-Sleep -s 5
122+
./redis-cli ping
123+
124+
- name: Install requirements
125+
run: |
126+
pip install setuptools
127+
pip install -r test-requirements.txt
128+
pip install -r test-filesource-optional-requirements.txt
129+
pip install -r consul-requirements.txt
130+
python setup.py install
131+
pip freeze
132+
133+
- name: Run tests
134+
run: pytest -s testing -W error::SyntaxWarning
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
lint-pr-title:
12+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Package
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
dry_run:
6+
description: 'Is this a dry run? If so no package will be published.'
7+
type: boolean
8+
required: true
9+
10+
jobs:
11+
build-publish:
12+
runs-on: ubuntu-latest
13+
# Needed to get tokens during publishing.
14+
permissions:
15+
id-token: write
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0
21+
name: 'Get PyPI token'
22+
with:
23+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
24+
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
25+
26+
- id: publish
27+
name: Publish Package
28+
uses: ./.github/actions/publish
29+
with:
30+
token: ${{env.PYPI_AUTH_TOKEN}}
31+
dry_run: ${{ inputs.dry_run }}

0 commit comments

Comments
 (0)