Skip to content

Commit 20ca3b4

Browse files
authored
Feature: setup macports (#55)
1 parent 5e635af commit 20ca3b4

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "setup macports"
2+
description: "setup MacPorts on macOS"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Cache MacPorts
7+
uses: actions/cache@v3
8+
id: cache-macports
9+
with:
10+
path: /opt/local/
11+
key: macports-v2.10.7-${{ runner.os }}-${{ inputs.compiler }}
12+
13+
- name: Fix MacPorts permissions
14+
if: ${{ steps.cache-macports.outputs.cache-hit == 'true' }}
15+
shell: bash
16+
run: sudo chown -R root:wheel /opt/local
17+
18+
- name: Install MacPorts
19+
if: ${{ steps.cache-macports.outputs.cache-hit != 'true' }}
20+
shell: bash
21+
run: |
22+
curl -LO https://github.com/macports/macports-base/releases/download/v2.10.7/MacPorts-2.10.7-15-Sequoia.pkg
23+
sudo installer -pkg MacPorts-2.10.7-15-Sequoia.pkg -target /
24+
25+
- name: Add MacPorts to system paths
26+
shell: bash
27+
run: |
28+
# so sudo can find port
29+
echo "/opt/local/bin" | sudo tee -a /etc/paths
30+
echo "/opt/local/sbin" | sudo tee -a /etc/paths
31+
# also ensure it’s in the user path
32+
echo "/opt/local/bin" >> $GITHUB_PATH
33+
hash -r

0 commit comments

Comments
 (0)