Skip to content

Create workflow to automate future releases - #133

Open
SaiTejaKundety wants to merge 1 commit into
masterfrom
release_ci
Open

Create workflow to automate future releases#133
SaiTejaKundety wants to merge 1 commit into
masterfrom
release_ci

Conversation

@SaiTejaKundety

@SaiTejaKundety SaiTejaKundety commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Why is this change being made?

  1. The module has no automated release process. The tagging and publishing process for GitHub releases were manual and did not have any error-checking. This adds a guarded, on-demand release workflow so releases are consistent and validated.

What is changing?

  1. Adds .github/workflows/release.yml, a manually-triggered
    (workflow_dispatch) release job that takes a version input and:
    • validates the input is strict semver (x.y.z);
    • verifies it matches Version in secretcache/versionInfo.go;
    • fails if the v<version> tag already exists (releases are immutable);
    • runs go build ./... and go test ./secretcache;
    • tags the commit and creates a GitHub Release with auto-generated notes.

Related Links

  • Issue #, if available:

Testing

How was this tested?

  1. Because this change is a release workflow, I tested it against a forked mirror of this repository to exercise the full flow safely without publishing a real release. I confirmed the version validation, tag-existence check, build/test steps, and release creation all behaved as expected.

When testing locally, provide testing artifact(s):

N/A — this is a GitHub Actions workflow and can't be run locally. It was validated by dispatching it on a forked mirror repo; see the run/release linked below.

This is an example workflow that was released on a forked version of the repository: https://github.com/SaiTejaKundety/aws-secretsmanager-caching-go-forked/actions/runs/31200227888/job/92938210279


Reviewee Checklist

Update the checklist after submitting the PR

  • I have reviewed, tested and understand all changes
    If not, why:
  • I have filled out the Description and Testing sections above
    If not, why:
  • Build and Unit tests are passing
    If not, why:
  • Unit test coverage check is passing
    If not, why:
  • Integration tests pass locally
    If not, why:
  • I have updated integration tests (if needed)
    If not, why: N/A
  • I have ensured no sensitive information is leaking (i.e., no logging of sensitive fields, or otherwise)
    If not, why:
  • I have added explanatory comments for complex logic, new classes/methods and new tests
    If not, why:
  • I have updated README/documentation (if needed)
    If not, why: N/A
  • I have clearly called out breaking changes (if any)
    If not, why: N/A

Reviewer Checklist

All reviewers please ensure the following are true before reviewing:

  • Reviewee checklist has been accurately filled out
  • Code changes align with stated purpose in description
  • Test coverage adequately validates the changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.55%. Comparing base (5011c01) to head (80c654e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #133   +/-   ##
=======================================
  Coverage   96.55%   96.55%           
=======================================
  Files           6        6           
  Lines         290      290           
=======================================
  Hits          280      280           
  Misses          8        8           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bob2681312
bob2681312 marked this pull request as ready for review August 7, 2026 18:30
@bob2681312
bob2681312 requested a review from a team as a code owner August 7, 2026 18:30
echo "::error::Requested version ($input) does not match Version in secretcache/versionInfo.go ($repo)."
exit 1
fi

@bob2681312 bob2681312 Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Consider adding a check to make sure the requested new version is correct with respect to the previously released version. e.g. v3.1.0 -> v3.1.1 is fine, but v3.1.0 -> v3.2.1 is not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would the latter example you provided not be ok?

exit 1
fi

- name: Build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can reuse existing workflows using workflow_call.

echo "::error::Requested version ($input) does not match Version in secretcache/versionInfo.go ($repo)."
exit 1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would the latter example you provided not be ok?

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.24"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might want to go with "stable". Or follow the other comment and reuse the build workflow.


jobs:
release:
runs-on: ubuntu-latest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate this workflow on an environment so we can restrict this to running under a 2PR.

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For our release workflows we tie GitHub actions we use to a SHA hash. This is to prevent supply chain attacks.

exit 1
fi

- name: Check tag does not already exist

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we just attempt the push? It will fail if the tag already exists.

GH_TOKEN: ${{ github.token }}
run: |
tag="v${{ github.event.inputs.version }}"
gh release create "$tag" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If a matching git tag does not yet exist, one will automatically get created from the latest state of the default branch. Use --target to point to a different branch or commit for the automatic tag creation. Use --verify-tag to abort the release if the tag doesn't already exist.

From https://cli.github.com/manual/gh_release_create

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

Successfully merging this pull request may close these issues.

3 participants