Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit ef6da40

Browse files
authored
Merge pull request #3 from iamamutt/main
Move flit to directory
2 parents 3c04dcc + 8ff151a commit ef6da40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+13216
-46
lines changed

.github/actions/bake-cookies/action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
build_branch:
1111
description: "Branch name that holds the generated content"
1212
required: false
13-
default: build
13+
default: build_test
1414

1515
folder:
1616
description: "Subdirectory for a specific template"
@@ -56,7 +56,7 @@ runs:
5656
- name: Upload Artifact Content
5757
uses: actions/upload-artifact@v3
5858
with:
59-
name: cookiecutter_content_${{ inputs.new_tag }}
59+
name: ${{ inputs.folder }}_${{ inputs.new_tag }}
6060
path: .build/${{ inputs.folder }}
6161

6262
- name: Create 'build' Branch
@@ -93,7 +93,7 @@ runs:
9393
- name: Downloading Artifact Content
9494
uses: actions/download-artifact@v3
9595
with:
96-
name: cookiecutter_content_${{ inputs.new_tag }}
96+
name: ${{ inputs.folder }}_${{ inputs.new_tag }}
9797
path: ${{ inputs.build_branch }}/${{ inputs.folder }}
9898

9999
- name: Copying Built Content to Branch
@@ -114,6 +114,11 @@ runs:
114114
working-directory: ${{ inputs.build_branch }}
115115
shell: bash
116116

117+
outputs:
118+
artifact:
119+
description: "Name of the uploaded artifact"
120+
value: ${{ inputs.folder }}_${{ inputs.new_tag }}
121+
117122
branding:
118123
icon: "aperture"
119124
color: "blue"

.github/workflows/ci.yml

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: run-ci-jobs
22

33
on:
44
push:
5-
branches: ["main", "flit"]
5+
branches: ["main"]
66

77
jobs:
88
get_tag:
@@ -19,97 +19,115 @@ jobs:
1919
id: tag_version
2020
with:
2121
github_token: ${{ secrets.GITHUB_TOKEN }}
22-
release_branches: main,flit
22+
release_branches: main
2323
create_annotated_tag: false
2424
fetch_all_tags: true
2525

26-
generate_flit_content:
26+
generate_workflow_content:
2727
runs-on: ubuntu-latest
2828
needs: get_tag
2929
if: |
3030
always() &&
3131
(needs.get_tag.result == 'success') &&
32-
(github.ref_name == 'flit') &&
32+
(github.ref_name == 'main') &&
3333
(github.ref_type == 'branch')
3434
steps:
3535
- name: Checkout Repository for Local Action
3636
uses: actions/checkout@v3
3737

38-
- name: Generate Content from 'flit' Template
38+
- name: Generate Content from 'workflow' Template
3939
id: bake-cookies
4040
uses: ./.github/actions/bake-cookies
4141
with:
4242
github_token: ${{ secrets.GITHUB_TOKEN }}
43-
folder: o-science-institute_w-neuro-lab
44-
cookiecutter_pkg: git+https://github.com/cookiecutter/cookiecutter
45-
cookiecutter_args: -f --no-input
43+
folder: workflow_name
44+
cookiecutter_args: -f --no-input --directory workflow
4645
new_tag: ${{ needs.get_tag.outputs.new_tag }}
46+
outputs:
47+
artifact: ${{ steps.bake-cookies.outputs.artifact }}
4748

48-
generate_workflow_content:
49+
generate_flit_content:
4950
runs-on: ubuntu-latest
50-
needs: [get_tag]
51+
needs: [get_tag, generate_workflow_content]
5152
if: |
5253
always() &&
5354
(needs.get_tag.result == 'success') &&
55+
(needs.generate_workflow_content.result == 'success') &&
5456
(github.ref_name == 'main') &&
5557
(github.ref_type == 'branch')
5658
steps:
5759
- name: Checkout Repository for Local Action
5860
uses: actions/checkout@v3
5961

60-
- name: Generate Content from 'workflow' Template
62+
- name: Generate Content from 'flit' Template
6163
id: bake-cookies
6264
uses: ./.github/actions/bake-cookies
6365
with:
6466
github_token: ${{ secrets.GITHUB_TOKEN }}
65-
folder: workflow_name
66-
cookiecutter_args: -f --no-input --directory workflow
67+
folder: o-science-institute_w-neuro-lab
68+
cookiecutter_pkg: git+https://github.com/cookiecutter/cookiecutter
69+
cookiecutter_args: -f --no-input --directory flit
6770
new_tag: ${{ needs.get_tag.outputs.new_tag }}
71+
outputs:
72+
artifact: ${{ steps.bake-cookies.outputs.artifact }}
6873

6974
generate_element_content:
7075
runs-on: ubuntu-latest
71-
needs: [get_tag, generate_workflow_content]
76+
needs: [get_tag, generate_flit_content]
7277
if: |
7378
always() &&
7479
(needs.get_tag.result == 'success') &&
75-
(needs.generate_workflow_content.result == 'success') &&
80+
(needs.generate_flit_content.result == 'success') &&
7681
(github.ref_name == 'main') &&
7782
(github.ref_type == 'branch')
7883
steps:
7984
- run: echo "Element template not yet available"
80-
# - name: Checkout Repository for Local Action
81-
# uses: actions/checkout@v3
85+
# - name: Checkout Repository for Local Action
86+
# uses: actions/checkout@v3
8287

83-
# - name: Generate Content from 'element' Template
84-
# id: bake-cookies
85-
# uses: ./.github/actions/bake-cookies
86-
# with:
87-
# github_token: ${{ secrets.GITHUB_TOKEN }}
88-
# folder: element_name
89-
# cookiecutter_args: -f --no-input --directory element
90-
# new_tag: ${{ needs.get_tag.outputs.new_tag }}
88+
# - name: Generate Content from 'element' Template
89+
# id: bake-cookies
90+
# uses: ./.github/actions/bake-cookies
91+
# with:
92+
# github_token: ${{ secrets.GITHUB_TOKEN }}
93+
# folder: element_name
94+
# cookiecutter_args: -f --no-input --directory element
95+
# new_tag: ${{ needs.get_tag.outputs.new_tag }}
96+
# outputs:
97+
# artifact: ${{ steps.bake-cookies.outputs.artifact }}
9198

9299
make_release:
93100
runs-on: ubuntu-latest
94-
needs: [get_tag, generate_flit_content, generate_element_content]
101+
needs:
102+
[
103+
get_tag,
104+
generate_flit_content,
105+
generate_workflow_content,
106+
generate_element_content,
107+
]
95108
if: |
96109
always() &&
97110
(needs.get_tag.result == 'success') &&
98-
(
99-
needs.generate_flit_content.result == 'success' ||
100-
needs.generate_element_content.result == 'success'
101-
)
111+
(needs.generate_element_content.result == 'success')
102112
steps:
103113
- name: Checkout Repository
104114
uses: actions/checkout@v3
105115

106-
- name: Downloading Artifact Content
116+
- name: Downloading 'flit' Artifact Content
117+
uses: actions/download-artifact@v3
118+
with:
119+
name: ${{ needs.generate_flit_content.outputs.artifact }}
120+
path: ${{ needs.generate_flit_content.outputs.artifact }}
121+
122+
- name: Downloading 'workflow' Artifact Content
107123
uses: actions/download-artifact@v3
108124
with:
109-
name: cookiecutter_content_${{ needs.get_tag.outputs.new_tag }}
110-
path: cookiecutter_content
125+
name: ${{ needs.generate_workflow_content.outputs.artifact }}
126+
path: ${{ needs.generate_workflow_content.outputs.artifact }}
111127

112-
- run: tar -zcf cookiecutter_content_${{ github.ref_name }}_${{ needs.get_tag.outputs.new_tag }}.tar.gz cookiecutter_content
128+
- run: |
129+
tar -zcf ${{ needs.generate_flit_content.outputs.artifact }}.tar.gz ${{ needs.generate_flit_content.outputs.artifact }}
130+
tar -zcf ${{ needs.generate_workflow_content.outputs.artifact }}.tar.gz ${{ needs.generate_workflow_content.outputs.artifact }}
113131
114132
- name: Create a Release
115133
uses: ncipollo/release-action@v1
@@ -120,4 +138,6 @@ jobs:
120138
body: ${{ needs.get_tag.outputs.changelog }}
121139
allowUpdates: true
122140
generateReleaseNotes: true
123-
artifacts: "cookiecutter_content_${{ github.ref_name }}_${{ needs.get_tag.outputs.new_tag }}.tar.gz"
141+
artifacts: |
142+
${{ needs.generate_flit_content.outputs.artifact }}.tar.gz
143+
${{ needs.generate_workflow_content.outputs.artifact }}.tar.gz

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,7 @@ dmypy.json
129129
.pyre/
130130

131131
.DS_Store
132-
*.code-workspace
133-
.build/
132+
/.build/
133+
/*.code-workspace
134+
/o-science-institute_w-neuro-lab
135+
/build/

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pip install cookiecutter
1818

1919
**Refer template from github repo or local directory**
2020
```
21-
cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory workflow
21+
cookiecutter [email protected]:datajoint-company/dj-cookiecutter.git --directory workflow
2222
# set value to each variable, or skip to use default value
2323
# a python project will be generated at ~/Project/project_name/
2424
@@ -27,20 +27,22 @@ cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory workflow
2727
cookiecutter ./existing_cookiecutter --directory workflow
2828
2929
# generate a project to a specific directory: ./Projects
30-
cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory workflow -o ./Project
30+
cookiecutter [email protected]:datajoint-company/dj-cookiecutter.git --directory workflow -o ./Project
3131
# files will be in ./Projects/project_name
3232
3333
# this repo supports multiple cookiecutter templates
34-
cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory element
34+
cookiecutter [email protected]:datajoint-company/dj-cookiecutter.git --directory element
3535
3636
# if you have already started working on your project and there are existing files
37-
cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory workflow --overwrite-if-exists
37+
cookiecutter [email protected]:datajoint-company/dj-cookiecutter.git --directory workflow --overwrite-if-exists
3838
# or
39-
cookiecutter [email protected]:Yambottle/dj-cookiecutter.git --directory workflow --skip-if-file-exists
39+
cookiecutter [email protected]:datajoint-company/dj-cookiecutter.git --directory workflow --skip-if-file-exists
4040
```
4141

4242
> Note: cookiecutter will cache/clone this specified template repo to your user directory's ~/.cookiecutters
4343
44+
> Note: the [`flit`](flit/README.md) template requires _cookiecutter>=2.0.0_
45+
4446
**context of cookiecutter.json**
4547
```
4648
{
@@ -59,4 +61,4 @@ If you want to know more details, read this [page](https://cookiecutter.readthed
5961

6062
---
6163
## License
62-
© Datajoint, 2022. Licensed under an MIT license.
64+
© Datajoint, 2022. Licensed under an MIT license.

flit/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__
2+
.DS_Store
3+
.nox
4+
*.egg-info
5+
.ipynb_checkpoints
6+
/*.code-workspace
7+
build/
8+
.build/
9+
/o-science-institute_w-neuro-lab

flit/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Joseph Burling
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)