Skip to content

Commit

Permalink
chore: Add dynamic versioning and release workflow and rename package…
Browse files Browse the repository at this point in the history
… to `meltano-tap-linkedin-ads` (#61)

* chore: Add dynamic versioning and release workflow

* Rename package to `meltano-tap-linkedin-ads` and update PyPI fields

* Support Python 3.11
  • Loading branch information
edgarrmondragon authored May 31, 2023
1 parent 200acae commit 7d72415
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 77 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

name: Test tap-linkedin-ads

on: [push]
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
workflow_dispatch:
inputs: {}

jobs:
pytest:
Expand All @@ -22,9 +28,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.2
run: |
pipx install poetry
poetry --version
- name: Install dependencies
run: |
poetry install
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nox==2023.4.22
nox-poetry==1.0.2
pip==23.1.2
poetry==1.5.0
poetry-dynamic-versioning==0.22.0
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish with Dynamic Versioning

on:
release:
types: [published]

permissions:
contents: write
id-token: write

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment: publishing
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins
- name: Build
run: poetry build

- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
file: dist/*.whl
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Publish
uses: pypa/[email protected]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ A full list of supported settings and capabilities is available by running: `tap

### Owner

The ```owner``` setting is required for pulling data from the VideoAds endpoint. You can find the owner ID by making a
The `owner` setting is required for pulling data from the VideoAds endpoint. You can find the owner ID by making a
request to the adAccounts endpoint:

https://api.linkedin.com/rest/adAccounts?q=search&start=0&count=10

The owner ID can be found in the response under "reference": "urn:li:organization:```{OWNER}```"
The owner ID can be found in the response under "reference": "urn:li:organization:`{OWNER}`"


## Installation
Expand All @@ -54,9 +54,9 @@ The tap requires a LinkedInAds OAuth 2.0 access token to make API requests

The access token requires the following permissions:

```r_ads```: read ads
```rw_ads```: read-write ads
```r_ads_reporting```: read ads reporting
`r_ads`: read ads
`rw_ads`: read-write ads
`r_ads_reporting`: read ads reporting

Access tokens expire after 60 days and require a user to manually authenticate
again. See the [LinkedInAds API docs](https://learn.microsoft.com/en-us/linkedin/shared/authentication/postman-getting-started) for more info
Expand Down
Loading

0 comments on commit 7d72415

Please sign in to comment.