-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: update lock files in ci * fix: format
- Loading branch information
Showing
11 changed files
with
358 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,59 @@ | ||
--- | ||
name: Task - Build & Push Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
DOCKER_REGISTRY: ghcr.io/${{ github.repository }} | ||
name: Task - Build & Push Docker Image | ||
|
||
jobs: | ||
build_containers: | ||
strategy: | ||
matrix: | ||
package: [pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
- name: Extract package version | ||
run: | | ||
export PACKAGE_VERSION=$(grep 'version = "' ./${{ matrix.package }}/pyproject.toml | grep -m 1 -e '[0-9][0-9a-zA-Z]*[-.a-z0-9]*' -o) | ||
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | ||
echo $PACKAGE_VERSION | ||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
DOCKER_REGISTRY: ghcr.io/${{ github.repository }} | ||
|
||
- name: Build and push pragma-sdk | ||
if: matrix.package == 'pragma-sdk' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./${{ matrix.package }}/Dockerfile | ||
push: true | ||
build-args: | | ||
PRAGMA_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }} | ||
target: production | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }} | ||
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest | ||
jobs: | ||
build_containers: | ||
strategy: | ||
matrix: | ||
package: | ||
[pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push other packages | ||
if: matrix.package != 'pragma-sdk' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./${{ matrix.package }}/Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }} | ||
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest | ||
bump_version: | ||
needs: [build_containers] | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/master') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install Commitizen | ||
run: pip install --upgrade Commitizen | ||
- name: Configure Git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Bump version | ||
run: | | ||
git fetch --tags | ||
cz bump --retry || echo "probably nothing to do" | ||
- name: Push changes | ||
run: | | ||
TAG=$(git tag --points-at HEAD) | ||
if [[ $TAG ]]; then | ||
echo "Version bumped to $TAG" | ||
git push | ||
git push --tags | ||
else | ||
echo "Version NOT bumped" | ||
fi | ||
|
||
- name: Extract package version | ||
run: | | ||
export PACKAGE_VERSION=$(grep 'version = "' ./${{ matrix.package }}/pyproject.toml | grep -m 1 -e '[0-9][0-9a-zA-Z]*[-.a-z0-9]*' -o) | ||
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | ||
echo $PACKAGE_VERSION | ||
- name: Build and push pragma-sdk | ||
if: matrix.package == 'pragma-sdk' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./${{ matrix.package }}/Dockerfile | ||
push: true | ||
build-args: | | ||
PRAGMA_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }} | ||
target: production | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }} | ||
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest | ||
- name: Build and push other packages | ||
if: matrix.package != 'pragma-sdk' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./${{ matrix.package }}/Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }} | ||
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,56 @@ | ||
--- | ||
name: Task - Lint, Format & Typecheck | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
name: Task - Lint, Format & Typecheck | ||
|
||
jobs: | ||
lint-format-typecheck: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package: [pragma-utils, pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python 3.12.4 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- name: Install dependencies | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry install | ||
- name: Check poetry.lock | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry lock --check | ||
- name: Run lint | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe lint | ||
- name: Run format | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe format_check | ||
- name: Run typecheck | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe typecheck | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
|
||
jobs: | ||
lint-format-typecheck: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package: | ||
[ | ||
pragma-utils, | ||
pragma-sdk, | ||
price-pusher, | ||
vrf-listener, | ||
checkpointer, | ||
merkle-maker, | ||
] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python 3.12.4 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- name: Install dependencies | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry install | ||
- name: Check poetry.lock | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry lock --check | ||
- name: Run lint | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe lint | ||
- name: Run format | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe format_check | ||
- name: Run typecheck | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe typecheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
--- | ||
name: Task - Publish Package to Test PyPi | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
name: Task - Publish Package to Test PyPi | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
|
||
defaults: | ||
run: | ||
working-directory: pragma-sdk | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test_pypi_publish: | ||
name: Upload package to Test PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- run: pipx inject poetry poetry-monorepo-dependency-plugin | ||
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
- run: poetry build -f sdist | ||
- run: poetry publish -r test-pypi --skip-existing | ||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
|
||
defaults: | ||
run: | ||
working-directory: pragma-sdk | ||
|
||
jobs: | ||
test_pypi_publish: | ||
name: Upload package to Test PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- run: pipx inject poetry poetry-monorepo-dependency-plugin | ||
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
- run: poetry build -f sdist | ||
- run: poetry publish -r test-pypi --skip-existing |
Oops, something went wrong.