DAS CLI Build #81
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: DAS CLI Build | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version" | |
required: true | |
jobs: | |
build-jupyter-notebook: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Dockerfile | |
run: docker build -f .docker/Dockerfile.jupyter-notebook -t trueagi/das:latest-jupyter-notebook . | |
- name: Login to DockerHub | |
if: success() | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push to DockerHub | |
run: docker push trueagi/das:latest-jupyter-notebook | |
build-das-cli: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
needs: build-jupyter-notebook | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Dockerfile | |
run: docker build -f .docker/Dockerfile.das-toolbox -t das-cli:latest . | |
- name: Build das-cli binary | |
run: docker run --rm -v "$(pwd)/dist/":/app/das/dist -e DAS_CLI_VERSION=${{ github.event.inputs.version }} das-cli:latest | |
- name: Upload das-cli artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: das-cli | |
path: dist/* | |
integration-tests: | |
runs-on: ubuntu-latest | |
needs: | |
- build-das-cli | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install requirements | |
run: |- | |
sudo apt -y update && sudo apt -y install make | |
cd /tmp | |
git clone --depth=1 --branch v1.11.0 https://github.com/bats-core/bats-core.git | |
cd bats-core | |
sudo ./install.sh /usr/local | |
cd - | |
- name: Download das-cli artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: das-cli | |
path: packages | |
- name: Installing das-cli package | |
run: sudo apt -y install $(find . -name *.deb -type f | head -n 1) | |
- name: Runnign integration tests | |
run: make integration_tests | |
tag: | |
needs: | |
- integration-tests | |
if: github.ref == 'refs/heads/master' | |
uses: singnet/das/.github/workflows/run-semver.yml@master | |
with: | |
version: ${{ github.event.inputs.version }} | |
version-strategy: bump-version-from-variable-value | |
job-image-namespace: trueagi | |
job-image-version-semver: semantic-versioning | |
main-branch: master | |
version-tag-regex-pattern: /^\d+\.\d+\.\d+$/ | |
version-require-confirmation: "true" | |
title: New version of das-cli | |
deliverable: Debian package named das-cli | |
secrets: inherit | |
deploy-das-cli: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
needs: integration-tests | |
steps: | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts | |
- name: Download das-cli artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: das-cli | |
path: packages | |
- name: Copy files to server | |
run: | | |
scp -r packages/* ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:${{ vars.SERVER_DEB_PACKAGES_PATH }} |