Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Commit 578a8f2

Browse files
authored
Merge pull request #56 from yambottle/main
U24 workflow CICD
2 parents df46b76 + 64a345d commit 578a8f2

15 files changed

+199
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: u24_workflow_before_release
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
workflow_dispatch:
10+
11+
anchor-dev-build-call: &dev-build-call
12+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
13+
14+
anchor-test-build-call: &test-build-call
15+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
16+
17+
anchor-prod-build-call: &prod-build-call
18+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
19+
20+
jobs:
21+
call_context_check:
22+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
23+
24+
call_u24_workflow_build_debian:
25+
!!merge <<: *$STAGE-build-call
26+
with:
27+
jhub_ver: 1.4.2
28+
py_ver: 3.9
29+
dist: debian
30+
codebook_base_hash: 561b765
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: u24_workflow_release_call
2+
3+
on:
4+
workflow_run:
5+
workflows: ["u24_workflow_tag_to_release"]
6+
types:
7+
- completed
8+
9+
anchor-dev-release-call: &dev-release-call
10+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main
11+
12+
anchor-test-release-call: &test-release-call
13+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main
14+
15+
anchor-prod-release-call: &prod-release-call
16+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main
17+
18+
anchor-dev-release-if: &dev-release-if
19+
if: >-
20+
github.event.workflow_run.conclusion == 'success' &&
21+
github.repository_owner == 'yambottle'
22+
23+
anchor-test-release-if: &test-release-if
24+
if: >-
25+
github.event.workflow_run.conclusion == 'success' &&
26+
github.repository_owner == 'yambottle'
27+
28+
anchor-prod-release-if: &prod-release-if
29+
if: >-
30+
github.event.workflow_run.conclusion == 'success' &&
31+
github.repository_owner == 'datajoint'
32+
33+
jobs:
34+
call_context_check:
35+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
36+
37+
call_u24_workflow_release_debian:
38+
!!merge <<: *$STAGE-release-if
39+
!!merge <<: *$STAGE-release-call
40+
with:
41+
jhub_ver: 1.4.2
42+
py_ver: 3.9
43+
dist: debian
44+
codebook_base_hash: 561b765
45+
secrets:
46+
REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}}
47+
REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: u24_workflow_tag_to_release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
- 'test*.*.*'
8+
9+
anchor-dev-build-call: &dev-build-call
10+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
11+
12+
anchor-test-build-call: &test-build-call
13+
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
14+
15+
anchor-prod-build-call: &prod-build-call
16+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
17+
18+
jobs:
19+
call_context_check:
20+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
21+
call_u24_workflow_build_debian:
22+
!!merge <<: *$STAGE-build-call
23+
with:
24+
jhub_ver: 1.4.2
25+
py_ver: 3.9
26+
dist: debian
27+
codebook_base_hash: 561b765
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# For Github Action that doesn't support anchor yet...
3+
# https://github.com/actions/runner/issues/1182
4+
5+
STAGE=$1
6+
# .yaml in .staging_workflows has to be named using a prefix 'anchored_', this will be removed when normalizing
7+
PREFIX="anchored_"
8+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
9+
for source in $(ls $SCRIPT_DIR | grep yaml)
10+
do
11+
target=${source#$PREFIX}
12+
export STAGE
13+
envsubst '${STAGE}' < $SCRIPT_DIR/$source | yq e 'explode(.) | del(.anchor-*)' > $SCRIPT_DIR/../workflows/$target
14+
done

.github/.test/.secrets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RAW_DEPLOY_KEY=
2+
GITHUB_TOKEN=
3+
REGISTRY_USERNAME=
4+
REGISTRY_PASSWORD=

.github/.test/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For local testing using act, you need to create few things:
2+
- make a `.test/artifacts` dir for `act --artifact-server-path ./.test/artifacts/`
3+
- make a `.test/.secrets` file similar as `.env` for `act --secret-file ./.test/.secrets`

.github/make-dev.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bash ./.staging_workflows/normalize.sh dev

.github/make-prod.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bash ./.staging_workflows/normalize.sh prod

.github/make-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bash ./.staging_workflows/normalize.sh test

.github/run-act.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
3+
bash $SCRIPT_DIR/.staging_workflows/normalize.sh dev
4+
cd ..
5+
act -P ubuntu-latest=drewyangdev/ubuntu:act-latest \
6+
--secret-file $SCRIPT_DIR/.test/.secrets \
7+
--artifact-server-path $SCRIPT_DIR/.test/artifacts/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: u24_workflow_before_release
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
workflow_dispatch:
10+
jobs:
11+
call_context_check:
12+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
13+
call_u24_workflow_build_debian:
14+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
15+
with:
16+
jhub_ver: 1.4.2
17+
py_ver: 3.9
18+
dist: debian
19+
codebook_base_hash: 561b765
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: u24_workflow_release_call
2+
on:
3+
workflow_run:
4+
workflows: ["u24_workflow_tag_to_release"]
5+
types:
6+
- completed
7+
jobs:
8+
call_context_check:
9+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
10+
call_u24_workflow_release_debian:
11+
if: >-
12+
github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint'
13+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main
14+
with:
15+
jhub_ver: 1.4.2
16+
py_ver: 3.9
17+
dist: debian
18+
codebook_base_hash: 561b765
19+
secrets:
20+
REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}}
21+
REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: u24_workflow_tag_to_release
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
- 'test*.*.*'
7+
jobs:
8+
call_context_check:
9+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
10+
call_u24_workflow_build_debian:
11+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main
12+
with:
13+
jhub_ver: 1.4.2
14+
py_ver: 3.9
15+
dist: debian
16+
codebook_base_hash: 561b765

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@ Diagram.ipynb
100100

101101
# docker, vscode
102102
.env
103+
*.pem
104+
105+
# vscode
103106
docker-compose.yml
104107
.vscode/settings.json

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ specific forks for tests.
5353

5454
+ Add - Version
5555

56-
[0.2.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.2.0
56+
[0.2.1]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.1...0.2.0
57+
[0.2.0]: https://github.com/datajoint/workflow-array-ephys/compare/0.2.0...0.1.0
5758
[0.1.0]: https://github.com/datajoint/workflow-array-ephys/releases/tag/0.1.0

0 commit comments

Comments
 (0)