Skip to content

Conversation

@Jasrags
Copy link
Contributor

@Jasrags Jasrags commented Jun 1, 2025

Description

This PR introduces a modular, reusable GitHub Actions setup for GoMud, improving maintainability and release automation. It adds support for semantic version tagging, cross-platform builds, Docker packaging, and Discord notifications on PRs and releases.

Auto Tag Overview

This PR introduces automatic semantic version tagging for the main branch. Commits containing #patch, #minor, or #major in their message will trigger the auto-tag workflow to create a new Git tag (e.g., v1.0.1). Pre-release tags (e.g., v1.0.1-feature.0) are generated when commits land on other branches, supporting preview builds and safe testing.

Default change level is #patch

Workflow Triggers Overview

  • run-tests.yml
    • Runs on pull requests targeting any branch
  • build-and-release.yml
    • Runs on any push to the master branch (typically after a version tag is pushed)
  • docker-package.yml
    • Runs on pull requests to master
    • Also runs on direct pushes to master and manual triggers
  • auto-tag.yml
    • Runs on push to any branch
    • Creates clean release tags when pushing to master
    • Creates pre-release tags for all other branches
  • discord-notify.yml
    • Runs only when a new pull request is opened

Changes

  • Created new workflows:
    • run-tests.yml: runs code generation and tests on PRs and manual triggers
    • build-and-release.yml: builds cross-platform binaries and publishes GitHub Releases on tag push
    • docker-package.yml: builds and pushes Docker images to GHCR on PRs, main branch pushes, and tags
    • auto-tag.yml: automatically tags commits on main using SemVer rules based on commit messages
    • discord-notify.yml: sends notifications to Discord when PRs are opened or releases are published
  • Changed workflow structure to reduce duplication by leveraging modular composite actions

@Jasrags Jasrags self-assigned this Jun 1, 2025
@Jasrags Jasrags added the enhancement New feature or request label Jun 1, 2025
@Jasrags Jasrags requested a review from Copilot June 1, 2025 21:19

This comment was marked as outdated.

@Jasrags Jasrags marked this pull request as ready for review June 3, 2025 23:52
@Jasrags Jasrags requested a review from Volte6 as a code owner June 3, 2025 23:52
@Jasrags Jasrags requested a review from Copilot June 3, 2025 23:52

This comment was marked as outdated.

@Jasrags Jasrags requested a review from Copilot June 3, 2025 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modularizes and DRYs up GoMud’s GitHub Actions by introducing composite actions and new workflows for testing, building, Docker packaging, version tagging, and Discord notifications.

  • Leverages three new composite actions (setup-go, codegen-and-test, discord-webhook) to replace repeated steps
  • Adds five workflows: run-tests.yml, docker-package.yml, build-and-release.yml, auto-tag.yml, and discord-notify.yml
  • Implements semantic version auto-tagging, cross-platform builds, Docker publishing, and Discord notifications

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/run-tests.yml Simplify test workflow using composites and broaden event filters
.github/workflows/docker-package.yml Refactor Docker packaging workflow to use composites
.github/workflows/discord-notify.yml New workflow for sending PR and release notifications to Discord
.github/workflows/build-and-release.yml Simplify build & release workflow with composites and branch trigger
.github/workflows/auto-tag.yml Add semantic version auto-tagging workflow
.github/actions/setup-go/action.yml Composite action to checkout and set up Go
.github/actions/codegen-and-test/action.yml Composite action to run codegen and tests
.github/actions/discord-webhook/action.yml Composite action to send messages via a Discord webhook
Comments suppressed due to low confidence (3)

.github/workflows/docker-package.yml:7

  • The push trigger no longer includes tags, so Docker packaging won’t run on new version tags; add tags: ['v*.*.*'] under push: to restore tag-based runs.
- master

.github/actions/discord-webhook/action.yml:19

  • [nitpick] The composite action redundantly checks out the repository even though the workflow already does so; consider removing this step to speed up execution.
-    - uses: actions/checkout@v4

.github/workflows/run-tests.yml:5

  • The workflow_dispatch trigger was removed, preventing manual runs of this workflow; re-add workflow_dispatch: under on: to allow manual triggering.
branches:

@@ -0,0 +1,41 @@
name: Notify Discord

on:
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow only listens to Pull Request opened events but includes release metadata steps; add a release event (e.g., release: types: [published]) or remove the release logic to align triggers with steps.

Copilot uses AI. Check for mistakes.
@Jasrags Jasrags merged commit 797cbbc into master Jun 13, 2025
7 checks passed
@Jasrags Jasrags deleted the github_actions_rework branch June 13, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants