Skip to content

Commit cc18531

Browse files
committed
Initial commit
0 parents  commit cc18531

11 files changed

+963
-0
lines changed

.github/script/STEP

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

.github/script/update-step.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
# Make sure this file is executable
3+
# chmod a+x .github/script/update-step.sh
4+
5+
echo "Check that we are on FROM_STEP"
6+
if [ "$(cat .github/script/STEP)" != $FROM_STEP ]
7+
then
8+
echo "Current step is not $FROM_STEP"
9+
exit 0
10+
fi
11+
12+
echo "Make sure we are on the main branch"
13+
git checkout main
14+
15+
echo "Remove 'open' from any <details> tags"
16+
sed -r 's/<details id=([0-9]+) open>/<details id=\1>/g' README.md > tmp
17+
mv tmp README.md
18+
19+
echo "Add 'open' to step TO_STEP"
20+
sed -r "s/<details id=$TO_STEP>/<details id=$TO_STEP open>/g" README.md > tmp
21+
mv tmp README.md
22+
23+
echo "Update the STEP file to TO_STEP"
24+
echo "$TO_STEP" > .github/script/STEP
25+
26+
echo "Commit the files, and push to main"
27+
git config user.name github-actions
28+
git config user.email [email protected]
29+
git add README.md
30+
git add .github/script/STEP
31+
git commit --message="Update to $TO_STEP in STEP and README.md"
32+
git push
33+
34+
echo "If BRANCH_NAME, update that branch as well"
35+
if git show-ref --quiet refs/heads/$BRANCH_NAME
36+
then
37+
git checkout $BRANCH_NAME
38+
git cherry-pick main
39+
git push
40+
else
41+
echo "Branch $BRANCH_NAME does not exist"
42+
fi

.github/workflows/0-start.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Step 0, Start
2+
3+
# This step triggers after the learner creates a new repository from the template
4+
# This step sets STEP to 1
5+
# This step closes <details id=0> and opens <details id=1>
6+
7+
# This will run every time we create push a commit to `main`
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- main
14+
15+
permissions:
16+
# Need `contents: read` to checkout the repository
17+
# Need `contents: write` to update the step metadata
18+
contents: write
19+
20+
jobs:
21+
on_start:
22+
name: On start
23+
24+
# We will only run this action when:
25+
# 1. This repository isn't the template repository
26+
# 2. The STEP is currently '0' (see update-step.sh)
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ github.repository_owner != 'githublearn' }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# TBD Include any additional set up steps here
42+
43+
# Update README to close <details id=0>
44+
# and open <details id=1>
45+
# and set STEP to '1'
46+
- name: Update to step 1
47+
run: ./.github/script/update-step.sh
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
FROM_STEP: 0
51+
TO_STEP: 1
52+
BRANCH_NAME: my-first-branch

.github/workflows/1-tbd.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Step 1, TBD
2+
3+
# This step triggers after TBD
4+
# This step sets STEP to 2
5+
# This step closes <details id=1> and opens <details id=2>
6+
7+
# This will run every time we TBD
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
TBD:
12+
13+
permissions:
14+
# Need `contents: read` to checkout the repository
15+
# Need `contents: write` to update the step metadata
16+
contents: write
17+
18+
jobs:
19+
on_TBD:
20+
name: On TBD
21+
22+
# We will only run this action when:
23+
# 1. This repository isn't the template repository
24+
# 2. The STEP is currently 1 (see update-step.sh)
25+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
26+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
27+
if: ${{ github.repository_owner != 'githublearn' }}
28+
29+
# We'll run Ubuntu for performance instead of Mac or Windows
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
# We'll need to check out the repository so that we can edit the README
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0 # Let's get all the branches
38+
39+
# TBD include any further steps here
40+
41+
# Update README to close <details id=1>
42+
# and open <details id=2>
43+
# and set STEP to '2'
44+
- name: Update to step 2
45+
run: ./.github/script/update-step.sh
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
FROM_STEP: 1
49+
TO_STEP: 2
50+
BRANCH_NAME: TBD

.github/workflows/2-tbd.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Step 2, TBD
2+
3+
# This step triggers after TBD
4+
# This step sets STEP to 3
5+
# This step closes <details id=2> and opens <details id=3>
6+
7+
# This will run every time we TBD
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
TBD:
12+
13+
permissions:
14+
# Need `contents: read` to checkout the repository
15+
# Need `contents: write` to update the step metadata
16+
contents: write
17+
18+
jobs:
19+
on_TBD:
20+
name: On TBD
21+
22+
# We will only run this action when:
23+
# 1. This repository isn't the template repository
24+
# 2. The STEP is currently 2 (see update-step.sh)
25+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
26+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
27+
if: ${{ github.repository_owner != 'githublearn' }}
28+
29+
# We'll run Ubuntu for performance instead of Mac or Windows
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
# We'll need to check out the repository so that we can edit the README
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0 # Let's get all the branches
38+
39+
# TBD include any further steps here
40+
41+
# Update README to close <details id=2>
42+
# and open <details id=3>
43+
# and set STEP to '3'
44+
- name: Update to step 3
45+
run: ./.github/script/update-step.sh
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
FROM_STEP: 2
49+
TO_STEP: 3
50+
BRANCH_NAME: TBD

.github/workflows/3-tbd.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Step 3, TBD
2+
3+
# This step triggers after TBD
4+
# This step sets STEP to 4
5+
# This step closes <details id=3> and opens <details id=4>
6+
7+
# This will run every time we TBD
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
TBD:
12+
13+
permissions:
14+
# Need `contents: read` to checkout the repository
15+
# Need `contents: write` to update the step metadata
16+
contents: write
17+
18+
jobs:
19+
on_TBD:
20+
name: On TBD
21+
22+
# We will only run this action when:
23+
# 1. This repository isn't the template repository
24+
# 2. The STEP is currently 3 (see update-step.sh)
25+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
26+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
27+
if: ${{ github.repository_owner != 'githublearn' }}
28+
29+
# We'll run Ubuntu for performance instead of Mac or Windows
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
# We'll need to check out the repository so that we can edit the README
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0 # Let's get all the branches
38+
39+
# TBD include any further steps here
40+
41+
# Update README to close <details id=3>
42+
# and open <details id=4>
43+
# and set STEP to '4'
44+
- name: Update to step 4
45+
run: ./.github/script/update-step.sh
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
FROM_STEP: 3
49+
TO_STEP: 4
50+
BRANCH_NAME: TBD

.github/workflows/4-tbd.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Step 4, TBD
2+
3+
# This step triggers after TBD
4+
# This step sets STEP to 5
5+
# This step closes <details id=4> and opens <details id=5>
6+
7+
# This will run every time we TBD
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
TBD:
12+
13+
permissions:
14+
# Need `contents: read` to checkout the repository
15+
# Need `contents: write` to update the step metadata
16+
contents: write
17+
18+
jobs:
19+
on_TBD:
20+
name: On TBD
21+
22+
# We will only run this action when:
23+
# 1. This repository isn't the template repository
24+
# 2. The STEP is currently 4 (see update-step.sh)
25+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
26+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
27+
if: ${{ github.repository_owner != 'githublearn' }}
28+
29+
# We'll run Ubuntu for performance instead of Mac or Windows
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
# We'll need to check out the repository so that we can edit the README
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0 # Let's get all the branches
38+
39+
# TBD include any further steps here
40+
41+
# Update README to close <details id=4>
42+
# and open <details id=5>
43+
# and set STEP to '5'
44+
- name: Update to step 5
45+
run: ./.github/script/update-step.sh
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
FROM_STEP: 4
49+
TO_STEP: 5
50+
BRANCH_NAME: TBD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Step 5, Merge your pull request
2+
3+
# This step triggers after a pull requst is merged to `main`
4+
# This step sets STEP to X
5+
# This step closes <details id=5> and opens <details id=X>
6+
7+
# This will run every time we create push a commit to `main`
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- main
14+
15+
permissions:
16+
# Need `contents: read` to checkout the repository
17+
# Need `contents: write` to update the step metadata
18+
contents: write
19+
20+
jobs:
21+
on_merge:
22+
name: On merge
23+
24+
# We will only run this action when:
25+
# 1. This repository isn't the template repository
26+
# 2. The STEP is currently 5 (see update-step.sh)
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ github.repository_owner != 'githublearn' }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# Update README to close <details id=5>
42+
# and open <details id=X>
43+
# and set STEP to 'X'
44+
- name: Update to step X
45+
run: ./.github/script/update-step.sh
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
FROM_STEP: 5
49+
TO_STEP: X
50+
BRANCH_NAME: TBD

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
*.log
26+
*.sql
27+
*.sqlite
28+
29+
# OS generated files #
30+
######################
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db

0 commit comments

Comments
 (0)