Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create workflow to submit solution #5

Open
brendanator opened this issue Jan 1, 2025 · 0 comments
Open

Create workflow to submit solution #5

brendanator opened this issue Jan 1, 2025 · 0 comments

Comments

@brendanator
Copy link
Contributor

  • Create GitHub workflow called submit-advent-of-code.yml
  • Trigger on
    • Push to main with file changes to puzzles/year_*/day_*/answer_part*.txt
    • workflow_dispatch
  • Set env vars
    • AOC_SESSION: secrets.AOC_SESSION
    • GH_TOKEN: secrets.USER_TOKEN
  • Set up
    • Check out repo - uses: actions/checkout@v4
    • Setup uv - uses astral-sh/setup-uv@v4 and uv sync
  • Set concurrency to only run one at a time in this repo and don't cancel in progress runs
  • Add permissions needed: content, issues
  • Submit solution using uv run advent_of_code.py submit {year} {day} {part}
    • Mark this step as successful even if the exit code was 1
  • Update results section in README.md by running uv run advent_of_code.py update-results {year}
  • If it was part 1 and the submission was correct:
    • download part two with uv run advent_of_code.py download {year} {day} and output the part which is printed by the command
  • Commit and push puzzles in puzzles with user GitHub Actions
  • Trigger create-puzzle-issue.yml using the year, day and part 2 as strings if part two was downloaded
    • uses: sourcery-ai/autonomous-advent-of-code/.github/workflows/create-puzzle-issue.yml@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant