Skip to content

A GitHub Action to bump MacPorts Portfile versions!

Notifications You must be signed in to change notification settings

harens/action-macports-bump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacPorts Bump Action

GitHub Workflow Status GitHub Workflow Status

MacPorts Logo

A GitHub Action to assist in updating MacPorts Portfiles!

⚠️ This Action is very early on in development, and is still currently being built. Watch this space! ⚠️

This action automatically sends a PR to update a project's Portfile following a new release.

  • For port maintainers, this means less time has to be spent manually checking and updating ports.
  • For users, this makes it easier to get updates for your software as soon as they come out.
  • For software authors, this helps to make sure the latest version of your software is always being packaged 📦 .

💻 Usage

name: MacPorts Bump Version

on:
  push:
    tags:
      - '*'

jobs:
  macports:
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Bump Version
        uses: harens/action-macports-bump@v1
        with:
          token: ${{secrets.TOKEN}}
          # Name of the port on MacPorts
          name: example

🎟️ Personal Access Token

Why this is required

The action runs gh auth login --with-token in order to create the PR through the user's account.

How to Generate

Click here to generate a Personal Access token with the minimum required scopes for GitHub cli to function (repo and read:org). See the gh auth login docs for more info about the scopes.

After generating the token, in the project repo page, go to Settings ➤ Secrets ➤ New secret. Paste the value in and give it a name (e.g. TOKEN). Add this token to the workflow file, such as above ${{secrets.TOKEN}}, where TOKEN is the name of the token generated.

📨 How it works

  1. Sets up MacPorts using the GiovanniBussi/macports-ci shell script
  2. Clones the macports-ports repo
  3. Installs and authenticates GitHub CLI
  4. Creates a local portfile repo, where the version number and checksums are updated
  5. Copies the changes to the main repo, and opens a PR

🔨 Contributing

Any change, big or small, that you think can help improve this action is more than welcome 🎉.

As well as this, feel free to open an issue with any new suggestions or bug reports. Every contribution is appreciated.

📜 Examples

🏗️ TODO

  • Add support for generating binary packages that do not require MacPorts on the target system via sudo port mpkg/mdmg. Although this is feasible and well documented, the issue with this is that it might be hard to generalise this process for many ports and it would make the action much slower.
  • Include an updating dependencies feature that could be useful for Go and Cargo packages in particular. This could make use of tools such as go2port.
  • Add an option to manually set the commit email address so as to reduce the number of scopes required.

✨ Acknowledgements

This project was inspired by dawidd6/action-homebrew-bump-formula, a similar GitHub Action for Homebrew.

GiovanniBussi/macports-ci also made setting up MacPorts on the fly much simpler. It worked flawlessly and had many advanced flags that were very useful.

📒 Notice of Non-Affiliation and Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with the MacPorts Project, or any of its subsidiaries or its affiliates. The official MacPorts Project website can be found at https://www.macports.org.

The name MacPorts as well as related names, marks, emblems and images are registered trademarks of their respective owners.