add solidblocks-do-pythong #1065
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
name: solidblocks | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'pelle' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-pre[0-9]*' | |
env: | |
#SKIP_TESTS: ${{ contains(github.event.head_commit.message, '#skip-tests') || contains(github.event.ref, '-pre') }} | |
SKIP_TESTS: true | |
concurrency: | |
group: solidblocks | |
cancel-in-progress: true | |
permissions: | |
pages: write | |
id-token: write | |
contents: write | |
packages: write | |
jobs: | |
solidblocks-cli: | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
job: | |
- { runner: macos-latest, target: macosX64 } | |
- { runner: macos-latest, target: macosArm64 } | |
- { runner: ubuntu-latest, target: linuxX64 } | |
- { runner: windows-latest, target: mingwX64 } | |
runs-on: ${{ matrix.job.runner }} | |
env: | |
BUILD_TARGET: ${{ matrix.job.target }} | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Build | |
shell: bash | |
working-directory: solidblocks-cli/ | |
run: ./do build | |
- name: Test | |
shell: bash | |
working-directory: solidblocks-cli/ | |
run: ./do test | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-cli-${{ matrix.job.target }} | |
path: | | |
solidblocks-cli/blcks-*-* | |
solidblocks-cli-test: | |
needs: | |
- solidblocks-cli | |
- solidblocks-cloud-init | |
- solidblocks-hetzner-test | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
job: | |
- { runner: macos-latest, target: macosX64 } | |
- { runner: macos-latest, target: macosArm64 } | |
- { runner: ubuntu-latest, target: linuxX64 } | |
- { runner: windows-latest, target: mingwX64 } | |
runs-on: ${{ matrix.job.runner }} | |
env: | |
BUILD_TARGET: ${{ matrix.job.target }} | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Rename blcks | |
shell: bash | |
run: | | |
find . | |
find ./solidblocks-cli-${{ matrix.job.target }}/blcks-* -type f -exec cp {} ./solidblocks-cli/ \; | |
chmod +x ./solidblocks-cli/blcks-* | |
find . | |
- name: Test Integration | |
shell: bash | |
working-directory: solidblocks-cli/ | |
run: ./do test-integration | |
solidblocks-shell: | |
runs-on: ubuntu-latest | |
env: | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
steps: | |
- name: install bzip2 | |
run: sudo apt-get install -y bzip2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: solidblocks-shell/do build | |
- name: Test Integration | |
run: solidblocks-shell/do test-integration | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-shell | |
path: | | |
solidblocks-shell/build/solidblocks-shell-*.zip | |
solidblocks-shell/build/snippets/* | |
solidblocks-do-python: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: false | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: solidblocks-do-python/do build | |
- name: Test Integration | |
run: solidblocks-do-python/do test | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-do-python | |
path: | | |
solidblocks-do-python/dist/solidblocks_do* | |
solidblocks-shell-test: | |
runs-on: ubuntu-latest | |
env: | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
needs: | |
- solidblocks-shell | |
steps: | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Test | |
run: solidblocks-shell/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-shell-test | |
path: | | |
**/build/reports/tests | |
solidblocks-test: | |
runs-on: ubuntu-latest | |
env: | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
steps: | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Test | |
run: solidblocks-test/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-test | |
path: | | |
**/build/reports/tests | |
solidblocks-hetzner-dns: | |
runs-on: ubuntu-latest | |
env: | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
steps: | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Test | |
run: solidblocks-hetzner-dns/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-hetzner-dns | |
path: | | |
**/build/reports/tests | |
solidblocks-cloud-init: | |
runs-on: ubuntu-latest | |
env: | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
- name: Build | |
run: solidblocks-cloud-init/do build | |
- name: Test | |
run: solidblocks-cloud-init/do test | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-cloud-init | |
path: | | |
solidblocks-cloud-init/build/solidblocks-cloud-init-*.zip | |
solidblocks-cloud-init/build/terraform-null-solidblocks-cloud-init-*.zip | |
solidblocks-cloud-init/build/solidblocks-cloud-init-bootstrap.sh | |
solidblocks-terraform: | |
runs-on: ubuntu-latest | |
env: | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
steps: | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
run: solidblocks-terraform/do build | |
- name: Test | |
run: solidblocks-terraform/do test | |
solidblocks-hetzner: | |
runs-on: ubuntu-latest | |
needs: | |
- solidblocks-cloud-init | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Build | |
run: solidblocks-hetzner/do build | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-hetzner | |
path: | | |
solidblocks-hetzner/build/snippets/* | |
solidblocks-hetzner/build/terraform-hcloud-solidblocks-rds-postgresql-*.zip | |
solidblocks-hetzner-test: | |
runs-on: ubuntu-latest | |
needs: | |
- solidblocks-hetzner | |
- solidblocks-rds-postgresql | |
strategy: | |
max-parallel: 4 | |
fail-fast: false | |
matrix: | |
test_name: [ test-migration, test-restore-local, test-restore-s3, test-restore-gcp, test-private-network, test-arm, test-ssl ] | |
env: | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
HETZNER_S3_ACCESS_KEY: ${{ secrets.HETZNER_S3_ACCESS_KEY }} | |
HETZNER_S3_SECRET_KEY: ${{ secrets.HETZNER_S3_SECRET_KEY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
- name: install postgresql-client | |
run: sudo apt-get install -y postgresql-client | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Build | |
run: solidblocks-hetzner/do build | |
- name: Test | |
run: solidblocks-hetzner/do ${{ matrix.test_name }} | |
solidblocks-minio: | |
name: solidblocks-minio | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
run: solidblocks-minio/do build | |
- name: Test | |
run: solidblocks-minio/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-minio-test | |
path: | | |
**/test/build/reports/tests | |
solidblocks-debug-container: | |
name: solidblocks-debug-container | |
env: | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
run: solidblocks-debug-container/do build | |
- name: Test | |
run: solidblocks-debug-container/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-debug-container-test | |
path: | | |
**/build/reports/tests | |
solidblocks-rds-postgresql: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
run: solidblocks-rds-postgresql/do build | |
solidblocks-rds-postgresql-test: | |
runs-on: ubuntu-latest | |
env: | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
needs: | |
- solidblocks-minio | |
- solidblocks-rds-postgresql | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Test | |
run: solidblocks-rds-postgresql/do test | |
- name: Archive Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: solidblocks-rds-postgresql-test | |
path: | | |
**/test/build/reports/tests | |
clean-cloud-resources: | |
runs-on: ubuntu-latest | |
env: | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }} | |
if: ${{ always() }} | |
needs: | |
- solidblocks-shell-test | |
- solidblocks-cloud-init | |
- solidblocks-minio | |
- solidblocks-rds-postgresql | |
- solidblocks-rds-postgresql-test | |
- solidblocks-hetzner | |
- solidblocks-cli-test | |
- solidblocks-cli | |
- solidblocks-hetzner-test | |
- solidblocks-debug-container | |
- solidblocks-terraform | |
- solidblocks-test | |
- solidblocks-hetzner-dns | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Hetzner Nuke | |
run: | | |
find ./solidblocks-cli-linuxX64/blcks-* -type f -exec cp {} blcks \; | |
chmod +x blcks | |
./blcks hetzner nuke --do-nuke | |
release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- solidblocks-shell | |
- solidblocks-cloud-init | |
- solidblocks-shell-test | |
- solidblocks-minio | |
- solidblocks-rds-postgresql | |
- solidblocks-cli | |
- solidblocks-do-python | |
- solidblocks-cli-test | |
- solidblocks-rds-postgresql-test | |
- solidblocks-hetzner | |
- solidblocks-hetzner-test | |
- solidblocks-debug-container | |
- solidblocks-shell-test | |
- solidblocks-terraform | |
- solidblocks-hetzner-dns | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Release Artifacts | |
env: | |
ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} | |
ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} | |
ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
run: ./do release-artifacts | |
- name: Release Artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: CHANGELOG.md | |
files: | | |
solidblocks-shell/solidblocks-shell-*.zip | |
solidblocks-shell/snippets/* | |
solidblocks-cloud-init/solidblocks-cloud-init-*.zip | |
solidblocks-cloud-init/terraform-null-solidblocks-cloud-init-*.zip | |
solidblocks-cloud-init/snippets/* | |
solidblocks-hetzner/snippets/*.zip | |
solidblocks-hetzner/terraform-hcloud-solidblocks-rds-postgresql-*.zip | |
solidblocks-cli-*/blcks-* | |
documentation: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- solidblocks-shell | |
- solidblocks-cloud-init | |
- solidblocks-shell-test | |
- solidblocks-minio | |
- solidblocks-rds-postgresql | |
- solidblocks-cli | |
- solidblocks-cli-test | |
- solidblocks-rds-postgresql-test | |
- solidblocks-hetzner | |
- solidblocks-hetzner-test | |
- solidblocks-debug-container | |
- solidblocks-shell-test | |
- solidblocks-terraform | |
- solidblocks-hetzner-dns | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Bootstrap | |
run: ./do bootstrap | |
- name: Build Documentation | |
run: ./do build-documentation | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './build/documentation/public' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@main | |