You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-72Lines changed: 71 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,89 +1,75 @@
1
-
# Advent of Code {year}
1
+
# 🎄 Advent of Code {year}
2
2
3
-
## Housekeeping
3
+
## ⚙️ Setup Guide
4
4
5
-
Before creating a new repository from this template, perform the following steps.
5
+
This guide will help you quickly configure a new repository from this template for the current year's Advent of Code.
6
6
7
-
### Personal Access Token Setup
7
+
> **❗ IMPORTANT: Template Maintenance**
8
+
>
9
+
> **Before starting the setup:** Ensure the **[Maintenance Tasks](#maintenance-tasks)** section is completed on the **template repository** to guarantee that all dependencies are up-to-date.
8
10
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
11
+
---
29
12
30
-
Open [dependency graph](https://github.com/Flashky/advent-of-code-yyyy/network/updates) settings
31
-
and manually run the following jobs:
13
+
### 🚀 1. New Repository Creation
32
14
33
-
-``pom.xml``
34
-
-``.github/workflows/build-report.yml``
15
+
1. Open the main page of the [template repository](https://github.com/Flashky/advent-of-code-yyyy).
16
+
2. Click **Use this template** and then **Create a new repository**.
17
+
3. Name the new repository (e.g., `advent-of-code-202X`).
35
18
36
-
Review and merge any pending pull requests.
19
+
### 🔑 2. Token and Secret Configuration
37
20
38
-
## New repository creation
21
+
You need to set up two tokens: the **GitHub** token (`PAT_TOKEN`) and the **Codacy** token (`CODACY_PROJECT_TOKEN`).
39
22
40
-
Follow this steps after housekeeping is finished.
23
+
#### A. 🐙 Personal Access Token (PAT)
41
24
42
-
### Creation
25
+
The `PAT_TOKEN` is necessary for GitHub Actions (like Dependabot and year update) to function correctly.
43
26
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``.
27
+
1.**Verify/Create the PAT:**
28
+
* Go to **[Personal access tokens (classic)](https://github.com/settings/tokens)**.
29
+
* If you don't have a token named `PAT_TOKEN` (or similar), click **Generate New Token**, select the `repo` scope, and **copy the generated token**.
30
+
* If an existing `PAT_TOKEN` is close to expiring, click on it, select **regenerate the token**, and **copy the new value**.
31
+
2.**Add the PAT to the new repository:**
32
+
* Go to **Settings / Secrets and variables / Actions**.
33
+
* Create a new repository secret: **Name:**`PAT_TOKEN`, **Secret:***\[Your Token]*
48
34
49
-
###Personal Access Token Setup
35
+
#### B. 🛡️ Codacy Project Token
50
36
51
-
Add the previously mentioned ``PAT_TOKEN``to this new repository.
37
+
Required to send code coverage reports.
52
38
53
-
### Codacy Project Token Setup
39
+
1.**Get the Codacy Token:**
40
+
* Go to [Codacy](https://app.codacy.com) and **add your new repository**.
41
+
* Open **Settings / Coverage** and **copy** the `CODACY_PROJECT_TOKEN` value.
42
+
2.**Add the Secret (x2):** You need to add the token in **two** locations.
43
+
***Actions:** Go to **Settings / Secrets and variables / Actions**.
44
+
* Create a new secret: **Name:**`CODACY_PROJECT_TOKEN`, **Secret:***\[Codacy Token]*
45
+
***Dependabot:** Go to **Settings / Secrets and variables / Dependabot secrets**.
46
+
* Create a new secret: **Name:**`CODACY_PROJECT_TOKEN`, **Secret:***\[Codacy Token]*
54
47
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
-
5. 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
-
6. Open **Settings / Secrets and variables / Dependabot secrets** and click on **New repository secret**:
62
-
1.**Name:**``CODACY_PROJECT_TOKEN``
63
-
2.**Secret:** The previously copied token.
48
+
> 💡 **Note:** Setting the secret for Dependabot is crucial to prevent automated Pull Requests from failing the coverage report job.
64
49
65
-
Dependabot secrets are used on Dependabot Pull Requests. Not setting up the ``CODACY_PROJECT_TOKEN`` will result in failing the sending coverage report to Codacy step job of the build.
50
+
### 📅 3. Year Update and Permissions
66
51
67
-
### Update repository information
52
+
1.**Configure Workflow Permissions:**
53
+
* Go to **Settings / Actions / General**.
54
+
* Under **Workflow permissions**, enable:
55
+
***Read and write permissions**.
56
+
***Allow GitHub Actions to create and approve pull requests**.
57
+
2.**Run "Update year" Workflow:**
58
+
* Go to the **Actions** tab and open the **Update year** workflow.
59
+
* Click **Run workflow**, type the **year** in `yyyy` format (e.g., `2025`), and **Run workflow**.
60
+
3.**Merge the Pull Request:**
61
+
* The workflow will automatically create a Pull Request.
62
+
***Open it**, verify the year changes are correct, and **merge** it.
68
63
69
-
1. Go to **Settings / Actions / General**.
70
-
2. Under **Workflow permissions**:
71
-
1. Enable **Read and write permissions**.
72
-
2. Enable **Allow GitHub Actions to create and approve pull requests**.
73
-
4. Go to **Actions** and open the **Update year** workflow:
74
-
1. Click on **Run workflow**.
75
-
2. Type the year in ``yyyy`` format and click on **Run workflow**.
64
+
> After merging, the repository description, topics, and all `README.md` and `pom.xml` files will be updated with the correct year.
76
65
77
-
After the workflow has ended a Pull Request will be created:
78
-
1. Open the **pull request**.
79
-
2. Verify everything is right and then **merge** it.
80
-
81
-
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.
66
+
### 💾 4. Data Repository Setup
82
67
83
-
### Data Repository Setup
68
+
To privately manage your input files for each day.
84
69
85
-
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.
86
-
2. Add the data repository as a [submodule](https://github.blog/2016-02-01-working-with-submodules/) using the command:
70
+
1.**Create Data Repository:**
71
+
* Create a **private** repository using the [advent-of-code-yyyy-data](https://github.com/Flashky/advent-of-code-yyyy-data) template.
72
+
2.**Add as a [Submodule](https://github.blog/2016-02-01-working-with-submodules/):**
0 commit comments