A GitHub Action to assist in updating MacPorts Portfiles!
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 📦 .
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
The action runs gh auth login --with-token
in order to create the PR through the user's account.
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.
- Sets up MacPorts using the GiovanniBussi/macports-ci shell script
- Clones the macports-ports repo
- Installs and authenticates GitHub CLI
- Creates a local portfile repo, where the version number and checksums are updated
- Copies the changes to the main repo, and opens a PR
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.
- This project's tests.yml
- 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.
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.
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.