extraymond / zotero-snap

snap for zotero
17 stars 8 forks source link

feat(update.yml): Add an update automation workflow #43

Closed maxsu closed 8 months ago

maxsu commented 10 months ago

Quick Summary:

Introducing an automated workflow to effortlessly keep zotero-snap up-to-date.

Key Features:

  1. Automated Checks: Daily checks for new Zotero releases.
  2. Auto-Update: Automatically updates snapcraft.yaml for new versions.
  3. Commit Changes: Commits updates directly to the master branch.
  4. Manual Trigger Option: For additional control.

Removals:

  1. main.yml: The main workflow previously created an issue for each upstream release. This has been removed, since we now handle those updates automatically.

How it works:

We streamline the workflow using 3rd party actions:

  1. oprypin/find-latest-tag: Fetches the latest Zotero tag.
  2. mikefarah/yq: Reads the current project version.
  3. stefanzweifel/git-auto-commit-action: Commits the changes.

Note: Due to yq removing empty lines, we're using sed to update the project version in snapcraft.yml. We can switch back to yq if preserving empty lines is not important.

Successful Test

Check out the test run here and the resulting commit here showing the applied changes.

Benefits

  1. Efficiency: Saves time and effort.
  2. Reliability: Ensures consistent and timely updates.

Next Steps

  1. Review & merge into master.
    • Let me know if you want the full yq solution.
  2. Trigger the first update (e.g., 6.0.27 => 6.0.30). (update workflow)
  3. Set up notifications; closely monitor initial updates.
  4. Feedback? I'd love to hear ideas for further improvements!

Looking forward to your thoughts on these changes!