Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/jsonref-1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Nov 21, 2024
2 parents 1362b4f + 249fa23 commit 283de0d
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 123 deletions.
93 changes: 0 additions & 93 deletions .github/workflows/cdk-publish.yml

This file was deleted.

124 changes: 108 additions & 16 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
name: Python Packaging
# This workflow builds the python package.
# On release tags, it also publishes to PyPI and DockerHub.
# If we rename the workflow file name, we have to also update the
# Trusted Publisher settings on PyPI.
name: Packaging and Publishing

on:
push:

workflow_dispatch:
inputs:
version:
description: "The version to publish, ie 1.0.0 or 1.0.0-dev1"
required: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', github.event.inputs.version) || github.ref }}

- uses: hynek/build-and-inspect-python-package@v2

- uses: actions/upload-artifact@v4
with:
name: Packages-${{ github.run_id }}
path: |
/tmp/baipp/dist/*.whl
/tmp/baipp/dist/*.tar.gz
publish:
name: Publish to PyPI
name: Publish CDK version to PyPI
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # Needed to upload artifacts to the release
id-token: write
contents: write
environment:
name: PyPI
url: "https://pypi.org/p/airbyte-cdk"
if: startsWith(github.ref, 'refs/tags/v')
name: PyPi
url: https://pypi.org/p/airbyte
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
name: Packages-${{ github.run_id }}
path: dist
- name: Attach Wheel to GitHub Release

- name: Upload wheel to release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -40,8 +57,83 @@ jobs:
overwrite: true
file_glob: true

- name: Publish to PyPI (${{vars.PYPI_PUBLISH_URL}})
uses: pypa/[email protected]
with:
# Can be toggled at the repository level between `https://upload.pypi.org/legacy/` and `https://test.pypi.org/legacy/`
repository-url: ${{vars.PYPI_PUBLISH_URL}}
- name: Publish to PyPI
uses: pypa/[email protected]

# publish_sdm:
# name: Publish SDM to DockerHub
# if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
# runs-on: ubuntu-latest
# needs: [publish]
# environment:
# name: DockerHub
# url: https://hub.docker.com/r/airbyte/source-declarative-manifest/tags

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Set Version (workflow_dispatch)
# if: github.event_name == 'workflow_dispatch'
# run: |
# VERSION=${{ github.event.inputs.version }}
# echo "Version input set to '${VERSION}'"
# # Remove the 'v' prefix if it exists
# VERSION=${VERSION#v}
# echo "Setting version to '$VERSION'"
# echo "VERSION=${VERSION}" >> $GITHUB_ENV

# - name: Set Version (tag)
# if: startsWith(github.ref, 'refs/tags/v')
# run: |
# VERSION=${{ github.ref_name }}
# echo "Version ref set to '${VERSION}'"
# # Remove the 'v' prefix if it exists
# VERSION=${VERSION#v}
# echo "Setting version to '$VERSION'"
# echo "VERSION=${VERSION}" >> $GITHUB_ENV

# # We need to download the build artifact again because the previous job was on a different runner
# - name: Download Build Artifact
# uses: actions/download-artifact@v4
# with:
# name: Packages-${{ github.run_id }}
# path: dist

# - name: Set up QEMU for multi-platform builds
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# - name: Check for existing tag
# run: |
# tag="airbyte/source-declarative-manifest:${{ env.VERSION }}"
# if [ -z "$tag" ]; then
# echo "Error: VERSION is not set. Ensure the tag follows the format 'refs/tags/vX.Y.Z'."
# exit 1
# fi
# echo "Checking if tag '$tag' exists on DockerHub..."
# if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
# echo "The tag '$tag' already exists on DockerHub. Skipping publish to prevent overwrite."
# exit 1
# fi
# echo "No existing tag '$tag' found. Proceeding with publish."

# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# push: true
# tags: |
# airbyte/source-declarative-manifest:latest
# airbyte/source-declarative-manifest:${{ env.VERSION }}
# airbyte/source-declarative-manifest:${{ github.sha }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WORKDIR /airbyte/integration_code

# Copy project files needed for build
COPY pyproject.toml poetry.lock README.md ./
COPY dist/*.whl ./dist/

# Install dependencies - ignore keyring warnings
RUN poetry config virtualenvs.create false \
Expand All @@ -13,6 +14,6 @@ RUN poetry config virtualenvs.create false \
COPY airbyte_cdk ./airbyte_cdk

# Build and install the package
RUN poetry build && pip install dist/*.whl
RUN pip install dist/*.whl

ENTRYPOINT ["poetry", "run", "source-declarative-manifest"]
26 changes: 13 additions & 13 deletions airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2790,21 +2790,21 @@ interpolation:
- created_at: "2020-01-01 00:00:00.000+00:00"
- updated_at: "2020-01-02 00:00:00.000+00:00"
macros:
- title: Now (UTC)
- title: now_utc
description: Returns the current date and time in the UTC timezone.
arguments: {}
return_type: Datetime
examples:
- "'{{ now_utc() }}' -> '2021-09-01 00:00:00+00:00'"
- "'{{ now_utc().strftime('%Y-%m-%d') }}' -> '2021-09-01'"
- title: Today (UTC)
- title: today_utc
description: Returns the current date in UTC timezone. The output is a date object.
arguments: {}
return_type: Date
examples:
- "'{{ today_utc() }}' -> '2021-09-01'"
- "'{{ today_utc().strftime('%Y/%m/%d')}}' -> '2021/09/01'"
- title: Timestamp
- title: timestamp
description: Converts a number or a string representing a datetime (formatted as ISO8601) to a timestamp. If the input is a number, it is converted to an int. If no timezone is specified, the string is interpreted as UTC.
arguments:
datetime: A string formatted as ISO8601 or an integer representing a unix timestamp
Expand All @@ -2815,15 +2815,15 @@ interpolation:
- "'{{ timestamp('2022-02-28T00:00:00Z') }}' -> 1646006400"
- "'{{ timestamp('2022-02-28 00:00:00Z') }}' -> 1646006400"
- "'{{ timestamp('2022-02-28T00:00:00-08:00') }}' -> 1646035200"
- title: Max
- title: max
description: Returns the largest object of a iterable, or or two or more arguments.
arguments:
args: iterable or a sequence of two or more arguments
return_type: Any
examples:
- "'{{ max(2, 3) }}' -> 3"
- "'{{ max([2, 3]) }}' -> 3"
- title: Day Delta
- title: day_delta
description: Returns the datetime of now() + num_days.
arguments:
num_days: The number of days to add to now
Expand All @@ -2833,16 +2833,16 @@ interpolation:
- "'{{ day_delta(1) }}' -> '2021-09-02T00:00:00.000000+0000'"
- "'{{ day_delta(-1) }}' -> '2021-08-31:00:00.000000+0000'"
- "'{{ day_delta(25, format='%Y-%m-%d') }}' -> '2021-09-02'"
- title: Duration
description: Converts an ISO8601 duratioin to datetime.timedelta.
- title: duration
description: Converts an ISO8601 duration to datetime timedelta.
arguments:
duration_string: "A string representing an ISO8601 duration. See https://www.digi.com/resources/documentation/digidocs//90001488-13/reference/r_iso_8601_duration_format.htm for more details."
return_type: datetime.timedelta
examples:
- "'{{ duration('P1D') }}' -> '1 day, 0:00:00'"
- "'{{ duration('P6DT23H') }}' -> '6 days, 23:00:00'"
- "'{{ (now_utc() - duration('P1D')).strftime('%Y-%m-%dT%H:%M:%SZ') }}' -> '2021-08-31T00:00:00Z'"
- title: Format Datetime
- title: format_datetime
description: Converts a datetime or a datetime-string to the specified format.
arguments:
datetime: The datetime object or a string to convert. If datetime is a string, it must be formatted as ISO8601.
Expand All @@ -2854,7 +2854,7 @@ interpolation:
- "{{ format_datetime(config['start_date'], '%Y-%m-%dT%H:%M:%S.%fZ') }}"
- "{{ format_datetime(config['start_date'], '%Y-%m-%dT%H:%M:%S.%fZ', '%a, %d %b %Y %H:%M:%S %z') }}"
filters:
- title: Hash
- title: hash
description: Convert the specified value to a hashed string.
arguments:
hash_type: Valid hash type for converts ('md5' as default value).
Expand All @@ -2864,26 +2864,26 @@ interpolation:
- "{{ 'Test client_secret' | hash() }} -> '3032d57a12f76b61a820e47b9a5a0cbb'"
- "{{ 'Test client_secret' | hash('md5') }} -> '3032d57a12f76b61a820e47b9a5a0cbb'"
- "{{ 'Test client_secret' | hash('md5', salt='salt') }} -> '5011a0168579c2d94cbbe1c6ad14327c'"
- title: Base64 encoder
- title: base64encode
description: Convert the specified value to a string in the base64 format.
arguments: {}
return_type: str
examples:
- "{{ 'Test client_secret' | base64encode }} -> 'VGVzdCBjbGllbnRfc2VjcmV0'"
- title: Base64 decoder
- title: base64decode
description: Decodes the specified base64 format value into a common string.
arguments: {}
return_type: str
examples:
- "{{ 'ZmFrZSByZWZyZXNoX3Rva2VuIHZhbHVl' | base64decode }} -> 'fake refresh_token value'"
- title: String
- title: string
description: Converts the specified value to a string.
arguments: {}
return_type: str
examples:
- '{{ 1 | string }} -> "1"'
- '{{ ["hello", "world" | string }} -> "["hello", "world"]"'
- title: Regex Search
- title: regex_search
description: Match the input string against a regular expression and return the first match.
arguments:
regex: The regular expression to search for. It must include a capture group.
Expand Down

0 comments on commit 283de0d

Please sign in to comment.