Skip to content

Conversation

@GLinnik21
Copy link
Collaborator

@GLinnik21 GLinnik21 commented May 12, 2025

This pull request updates the .github/workflows/release.yml file to improve the release workflow by refining input parameters, updating dependencies, and simplifying the logic. The most important changes include replacing the test_fail input with a new publish_only input, updating dependencies, and adding conditional checks to streamline the workflow.

Input Parameter Updates:

  • Replaced the test_fail input with a new publish_only input, which allows publishing to CocoaPods without version updates or tagging. Updated descriptions for version and dry_run inputs for clarity. ([.github/workflows/release.ymlL7-R35](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L7-R35))

Dependency Updates:

  • Updated runs-on to macos-15 and upgraded the actions/checkout dependency from v2 to v4. ([.github/workflows/release.ymlL7-R35](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L7-R35))

Workflow Logic Simplifications:

  • Removed all test failure steps (test_fail logic) for various stages of the workflow, simplifying the process. ([[1]](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L55-L60), [[2]](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L121-R121))
  • Added conditional checks to skip version commits, saving commit information, and creating git tags when publish_only is set to true. ([[1]](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R83), [[2]](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R93-R100), [[3]](https://github.com/kstenerud/KSCrash/pull/629/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R93-R100))

@GLinnik21 GLinnik21 changed the title Update release workflow: Remove test functionality and add skip_tag option Update release workflow: Remove test functionality and add publish_only option May 12, 2025
@GLinnik21 GLinnik21 force-pushed the update-release-workflow branch from ba88fc2 to caa7834 Compare May 12, 2025 01:53
@GLinnik21 GLinnik21 requested a review from Copilot May 12, 2025 01:55
@GLinnik21 GLinnik21 merged commit d3db073 into master May 12, 2025
4 checks passed
@GLinnik21 GLinnik21 deleted the update-release-workflow branch May 12, 2025 01: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 pull request refines the release workflow by updating input parameters, dependencies, and simplifying the conditional logic in the release process.

  • Replaces the 'test_fail' input with a new 'publish_only' input.
  • Updates dependency versions (actions/checkout and OS version).
  • Adds conditional checks to skip version commits, tag creation, and commit information saving when 'publish_only' is enabled.
Comments suppressed due to low confidence (1)

.github/workflows/release.yml:124

  • [nitpick] The 'rollback' job still uses actions/checkout@v2 while the main release job has been updated to actions/checkout@v4. Consider updating it for consistency and potential improvements.
uses: actions/checkout@v2

- name: Commit version update
id: commit_version
if: ${{ github.event.inputs.publish_only != 'true' }}
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

The condition compares the boolean 'publish_only' input to the string 'true'. It is recommended to use boolean comparisons (e.g., if: ${{ !github.event.inputs.publish_only }}) to avoid potential type inconsistencies.

Suggested change
if: ${{ github.event.inputs.publish_only != 'true' }}
if: ${{ !github.event.inputs.publish_only }}

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +100
if: ${{ github.event.inputs.publish_only != 'true' }}
run: |
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
- name: Test failure - After commit
if: ${{ github.event.inputs.test_fail == 'mid' }}
run: |
echo "Intentionally failing after commit but before tag for testing"
exit 1
- name: Create git tag
id: create_tag
if: ${{ github.event.inputs.publish_only != 'true' }}
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

The condition compares the boolean 'publish_only' input to the string 'true'. Consider using a proper boolean check for clarity and consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +100
if: ${{ github.event.inputs.publish_only != 'true' }}
run: |
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
- name: Test failure - After commit
if: ${{ github.event.inputs.test_fail == 'mid' }}
run: |
echo "Intentionally failing after commit but before tag for testing"
exit 1
- name: Create git tag
id: create_tag
if: ${{ github.event.inputs.publish_only != 'true' }}
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

The condition compares the boolean 'publish_only' input to the string 'true'. Use a boolean expression to improve reliability and readability.

Copilot uses AI. Check for mistakes.
- name: Publish to CocoaPods
if: ${{ !github.event.inputs.dry_run && github.event.inputs.test_fail != 'any' }}
if: ${{ github.event.inputs.dry_run != 'true' }}
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

The 'dry_run' input is defined as a boolean, so comparing it against the string 'true' might lead to unexpected behavior. Consider using a boolean check (e.g., if: ${{ !github.event.inputs.dry_run }}) for consistency.

Suggested change
if: ${{ github.event.inputs.dry_run != 'true' }}
if: ${{ !github.event.inputs.dry_run }}

Copilot uses AI. Check for mistakes.
runs-on: macos-15
needs: release
if: failure()
if: failure() && github.event.inputs.publish_only != 'true'
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

The condition compares the boolean 'publish_only' input to the string 'true'. Use a boolean check (e.g., && !github.event.inputs.publish_only) for proper evaluation.

Suggested change
if: failure() && github.event.inputs.publish_only != 'true'
if: failure() && !github.event.inputs.publish_only

Copilot uses AI. Check for mistakes.
DariaKunoichi pushed a commit to bugsnag/KSCrash that referenced this pull request Jul 2, 2025
…nly` option (kstenerud#629)

* Update release workflow: remove test functionality and add skip_tag option

* Update release workflow: rename parameter to publish_only and clarify descriptions

* Fix workflow conditions to properly handle all parameter combinations

* Use macOS-15 runner and upgrade checkout to v4
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.

2 participants