|
| 1 | +# Advent of Code {year} |
| 2 | + |
| 3 | +## Housekeeping |
| 4 | + |
| 5 | +Before creating a new repository from this template, perform the following steps. |
| 6 | + |
| 7 | +### Personal Access Token Setup |
| 8 | + |
| 9 | +Open **[Personal access tokens (classic)](https://github.com/settings/tokens)** settings and verify if there is any |
| 10 | +``PAT_TOKEN`` or if it is nearly to expire. |
| 11 | + |
| 12 | +#### Creation of a new token |
| 13 | + |
| 14 | +If there is no ``PAT_TOKEN`` created: |
| 15 | + |
| 16 | +1. Click on **Generate New Token**. |
| 17 | +2. Select ``repo`` checkbox. |
| 18 | +3. Copy the token. |
| 19 | + |
| 20 | +#### Refresh of an existing token |
| 21 | + |
| 22 | +If there is an existing ``PAT_TOKEN``: |
| 23 | + |
| 24 | +1. Click on it. |
| 25 | +2. If the expiration date is due soon, click on **regenerate the token**. |
| 26 | +3. Update the ``PAT_TOKEN`` at this template repository. |
| 27 | + |
| 28 | +### Update dependencies |
| 29 | + |
| 30 | +Open [dependency graph](https://github.com/Flashky/advent-of-code-yyyy/network/updates) settings |
| 31 | +and manually run the following jobs: |
| 32 | + |
| 33 | +- ``pom.xml`` |
| 34 | +- ``.github/workflows/build-report.yml`` |
| 35 | + |
| 36 | +Review and merge any pending pull requests. |
| 37 | + |
| 38 | +## New repository creation |
| 39 | + |
| 40 | +Follow this steps after housekeeping is finished. |
| 41 | + |
| 42 | +### Creation |
| 43 | + |
| 44 | +1. Open the main page of the [template repository](https://github.com/Flashky/advent-of-code-yyyy). |
| 45 | +2. Click on **Use this template**. |
| 46 | +3. Select **Create a new repository**: |
| 47 | + 1. Give a name to the new repository. Example: ``advent-of-code-2022``. |
| 48 | + |
| 49 | +### Personal Access Token Setup |
| 50 | + |
| 51 | +Add the previously mentioned ``PAT_TOKEN`` to this new repository. |
| 52 | + |
| 53 | +### Codacy Project Token Setup |
| 54 | + |
| 55 | +1. Go to [Codacy](https://app.codacy.com) and add the repository. |
| 56 | +2. Open **Settings / Coverage** and copy the ``CODACY_PROJECT_TOKEN`` value. |
| 57 | +3. Open the created repository. |
| 58 | +4. Open **Settings / Secrets and variables / Actions** and click on **New repository secret**: |
| 59 | + 1. **Name:** ``CODACY_PROJECT_TOKEN`` |
| 60 | + 2. **Secret:** The previously copied token. |
| 61 | + |
| 62 | +### Update repository information |
| 63 | + |
| 64 | +1. Go to **Settings / Actions / General**. |
| 65 | +2. Under **Workflow permissions**: |
| 66 | + 1. Enable **Read and write permissions**. |
| 67 | + 2. Enable **Allow GitHub Actions to create and approve pull requests**. |
| 68 | +4. Go to **Actions** and open the **Update year** workflow: |
| 69 | + 1. Click on **Run workflow**. |
| 70 | + 2. Type the year in ``yyyy`` format and click on **Run workflow**. |
| 71 | + |
| 72 | +After the workflow has ended a Pull Request will be created: |
| 73 | +1. Open the [pull request](https://github.com/Flashky/advent-of-code-{year}/pull/1). |
| 74 | +2. Verify everything is right and then **merge** it. |
| 75 | + |
| 76 | +After the PR is merged the repository will have its description and topics updated. Also, all ``README.md`` and ``pom.xml`` will be updated with current year value. The PR can be declined and workflow can be executed again if there was any problem that needed a fix. |
| 77 | + |
| 78 | +### Data Repository Setup |
| 79 | + |
| 80 | +1. Create a private data repository using [advent-of-code-yyyy-data](https://github.com/Flashky/advent-of-code-yyyy-data) template repository and set it up. |
| 81 | +2. Add the data repository as a [submodule](https://github.blog/2016-02-01-working-with-submodules/) using the command: |
| 82 | + |
| 83 | +```bash |
| 84 | +git clone https://github.com/Flashky/advent-of-code-{year}.git && |
| 85 | +git submodule add -b master https://github.com/Flashky/advent-of-code-{year}-data.git advent-of-code-{year}/src/test/resources/inputs && |
| 86 | +git push |
| 87 | +``` |
| 88 | + |
| 89 | +### Codacy Badges Setup |
| 90 | + |
| 91 | +1. Go to [Codacy](https://app.codacy.com) and open the repository. |
| 92 | +2. Open **Settings / General** and copy both the ``code quality`` and ``coverage`` badges. |
| 93 | +3. Add them to this ``README.md``. |
| 94 | + |
| 95 | +### Almost done... |
| 96 | + |
| 97 | +1. Remove these instructions from ``README.md``. |
| 98 | +2. Push the changes and... |
| 99 | + |
| 100 | +**Enjoy your new Advent of Code edition!** |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +- [Day 1](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day01) |
| 105 | +- [Day 2](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day02) |
| 106 | +- [Day 3](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day03) |
| 107 | +- [Day 4](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day04) |
| 108 | +- [Day 5](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day05) |
| 109 | +- [Day 6](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day06) |
| 110 | +- [Day 7](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day07) |
| 111 | +- [Day 8](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day08) |
| 112 | +- [Day 9](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day09) |
| 113 | +- [Day 10](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day10) |
| 114 | +- [Day 11](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day11) |
| 115 | +- [Day 12](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day12) |
| 116 | +- [Day 13](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day13) |
| 117 | +- [Day 14](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day14) |
| 118 | +- [Day 15](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day15) |
| 119 | +- [Day 16](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day16) |
| 120 | +- [Day 17](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day17) |
| 121 | +- [Day 18](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day18) |
| 122 | +- [Day 19](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day19) |
| 123 | +- [Day 20](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day20) |
| 124 | +- [Day 21](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day21) |
| 125 | +- [Day 22](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day22) |
| 126 | +- [Day 23](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day23) |
| 127 | +- [Day 24](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day24) |
| 128 | +- [Day 25](https://github.com/Flashky/advent-of-code-{year}/tree/master/src/main/java/com/adventofcode/flashk/day25) |
| 129 | + |
| 130 | +## Cloning this repository |
| 131 | + |
| 132 | +Without data repository: |
| 133 | + |
| 134 | +```bash |
| 135 | +git clone https://github.com/Flashky/advent-of-code-{year}.git |
| 136 | +``` |
| 137 | + |
| 138 | +Including data repository: |
| 139 | + |
| 140 | +```bash |
| 141 | +git clone https://github.com/Flashky/advent-of-code-{year}.git --recurse-submodules |
| 142 | +``` |
| 143 | + |
| 144 | +## About |
| 145 | + |
| 146 | +- [Advent of Code](https://adventofcode.com/{year}/about) |
0 commit comments