diff --git a/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml new file mode 100644 index 00000000..14a345b6 --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_before_release.yaml @@ -0,0 +1,30 @@ +name: u24_workflow_before_release +on: + pull_request: + push: + branches: + - '**' + tags-ignore: + - '**' + workflow_dispatch: + +anchor-dev-build-call: &dev-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-test-build-call: &test-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-prod-build-call: &prod-build-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + + call_u24_workflow_build_debian: + !!merge <<: *$STAGE-build-call + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 \ No newline at end of file diff --git a/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml new file mode 100644 index 00000000..fd22db18 --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_release_call.yaml @@ -0,0 +1,47 @@ +name: u24_workflow_release_call + +on: + workflow_run: + workflows: ["u24_workflow_tag_to_release"] + types: + - completed + +anchor-dev-release-call: &dev-release-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-test-release-call: &test-release-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-prod-release-call: &prod-release-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + +anchor-dev-release-if: &dev-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'yambottle' + +anchor-test-release-if: &test-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'yambottle' + +anchor-prod-release-if: &prod-release-if + if: >- + github.event.workflow_run.conclusion == 'success' && + github.repository_owner == 'datajoint' + +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + + call_u24_workflow_release_debian: + !!merge <<: *$STAGE-release-if + !!merge <<: *$STAGE-release-call + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 + secrets: + REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file diff --git a/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml new file mode 100644 index 00000000..ade13755 --- /dev/null +++ b/.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml @@ -0,0 +1,27 @@ +name: u24_workflow_tag_to_release + +on: + push: + tags: + - '*.*.*' + - 'test*.*.*' + +anchor-dev-build-call: &dev-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-test-build-call: &test-build-call + uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +anchor-prod-build-call: &prod-build-call + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_build_debian: + !!merge <<: *$STAGE-build-call + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 \ No newline at end of file diff --git a/.github/.staging_workflows/normalize.sh b/.github/.staging_workflows/normalize.sh new file mode 100644 index 00000000..08619ee2 --- /dev/null +++ b/.github/.staging_workflows/normalize.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# For Github Action that doesn't support anchor yet... +# https://github.com/actions/runner/issues/1182 + +STAGE=$1 +# .yaml in .staging_workflows has to be named using a prefix 'anchored_', this will be removed when normalizing +PREFIX="anchored_" +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +for source in $(ls $SCRIPT_DIR | grep yaml) +do + target=${source#$PREFIX} + export STAGE + envsubst '${STAGE}' < $SCRIPT_DIR/$source | yq e 'explode(.) | del(.anchor-*)' > $SCRIPT_DIR/../workflows/$target +done \ No newline at end of file diff --git a/.github/.test/.secrets b/.github/.test/.secrets new file mode 100644 index 00000000..0cdd0de7 --- /dev/null +++ b/.github/.test/.secrets @@ -0,0 +1,4 @@ +RAW_DEPLOY_KEY= +GITHUB_TOKEN= +REGISTRY_USERNAME= +REGISTRY_PASSWORD= \ No newline at end of file diff --git a/.github/.test/README.md b/.github/.test/README.md new file mode 100644 index 00000000..3ffc63a0 --- /dev/null +++ b/.github/.test/README.md @@ -0,0 +1,3 @@ +For local testing using act, you need to create few things: +- make a `.test/artifacts` dir for `act --artifact-server-path ./.test/artifacts/` +- make a `.test/.secrets` file similar as `.env` for `act --secret-file ./.test/.secrets` \ No newline at end of file diff --git a/.github/make-dev.sh b/.github/make-dev.sh new file mode 100644 index 00000000..e9bdb38e --- /dev/null +++ b/.github/make-dev.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh dev \ No newline at end of file diff --git a/.github/make-prod.sh b/.github/make-prod.sh new file mode 100644 index 00000000..806e39ef --- /dev/null +++ b/.github/make-prod.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh prod \ No newline at end of file diff --git a/.github/make-test.sh b/.github/make-test.sh new file mode 100644 index 00000000..3870e77d --- /dev/null +++ b/.github/make-test.sh @@ -0,0 +1,2 @@ +#!/bin/bash +bash ./.staging_workflows/normalize.sh test \ No newline at end of file diff --git a/.github/run-act.sh b/.github/run-act.sh new file mode 100644 index 00000000..4ae9cdfb --- /dev/null +++ b/.github/run-act.sh @@ -0,0 +1,7 @@ +#!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +bash $SCRIPT_DIR/.staging_workflows/normalize.sh dev +cd .. +act -P ubuntu-latest=drewyangdev/ubuntu:act-latest \ + --secret-file $SCRIPT_DIR/.test/.secrets \ + --artifact-server-path $SCRIPT_DIR/.test/artifacts/ \ No newline at end of file diff --git a/.github/workflows/u24_workflow_before_release.yaml b/.github/workflows/u24_workflow_before_release.yaml new file mode 100644 index 00000000..ab7d8ce1 --- /dev/null +++ b/.github/workflows/u24_workflow_before_release.yaml @@ -0,0 +1,19 @@ +name: u24_workflow_before_release +on: + pull_request: + push: + branches: + - '**' + tags-ignore: + - '**' + workflow_dispatch: +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_build_debian: + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 diff --git a/.github/workflows/u24_workflow_release_call.yaml b/.github/workflows/u24_workflow_release_call.yaml new file mode 100644 index 00000000..f440c11e --- /dev/null +++ b/.github/workflows/u24_workflow_release_call.yaml @@ -0,0 +1,21 @@ +name: u24_workflow_release_call +on: + workflow_run: + workflows: ["u24_workflow_tag_to_release"] + types: + - completed +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_release_debian: + if: >- + github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint' + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 + secrets: + REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} + REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} diff --git a/.github/workflows/u24_workflow_tag_to_release.yaml b/.github/workflows/u24_workflow_tag_to_release.yaml new file mode 100644 index 00000000..3dd9bace --- /dev/null +++ b/.github/workflows/u24_workflow_tag_to_release.yaml @@ -0,0 +1,16 @@ +name: u24_workflow_tag_to_release +on: + push: + tags: + - '*.*.*' + - 'test*.*.*' +jobs: + call_context_check: + uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main + call_u24_workflow_build_debian: + uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main + with: + jhub_ver: 1.4.2 + py_ver: 3.9 + dist: debian + codebook_base_hash: 561b765 diff --git a/.gitignore b/.gitignore index 92c0b9e4..83a9e529 100644 --- a/.gitignore +++ b/.gitignore @@ -100,5 +100,8 @@ Diagram.ipynb # docker, vscode .env +*.pem + +# vscode docker-compose.yml .vscode/settings.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 1326a294..5fd67d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,5 +53,6 @@ specific forks for tests. + Add - Version -[0.2.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.2.0 +[0.2.1]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.1...0.2.0 +[0.2.0]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.0...0.1.0 [0.1.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.1.0 \ No newline at end of file