Skip to content

MacPorts 2.9.0 CI

MacPorts 2.9.0 CI #19

Workflow file for this run

---
name: "Build & Deploy MacPorts Base for CI"
on:
release:
types:
- created
workflow_dispatch:
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 64
- name: Cleanup /usr/local
run: |
sudo mkdir /opt/local.old
sudo mv /usr/local/* /opt/local.old
- name: Fetch & Extract MacPorts Base
run: |
set -eu
tag=$(basename $GITHUB_REF)
version=$(echo $tag | colrm 1 1)
curl -LO https://github.com/macports/macports-base/releases/download/${tag}/MacPorts-${version}.tar.bz2 \
-O https://github.com/macports/macports-base/releases/download/${tag}/MacPorts-${version}.tar.bz2.sha256.sig
openssl dgst -sha256 -verify jmr-pubkey.pem -signature MacPorts-${version}.tar.bz2.sha256.sig \
MacPorts-${version}.tar.bz2
tar -xjf MacPorts-${version}.tar.bz2
mv MacPorts-${version} MacPorts
rm MacPorts-${version}.tar.bz2 MacPorts-${version}.tar.bz2.sha256.sig
- name: Configure MacPorts Base
run: |
set -eu
cd MacPorts
./configure
- name: Build MacPorts Base
run: |
set -eu
cd MacPorts
make -j$(sysctl -n hw.activecpu)
- name: Install MacPorts Base
run: |
set -eu
cd MacPorts
sudo make install
- name: Test MacPorts Base
continue-on-error: true
run: |
set -eu
cd MacPorts
make test
- name: Prepare Deployment
run: |
set -eu
tag=$(basename $GITHUB_REF)
version=$(echo $tag | colrm 1 1)
cd MacPorts
sed -i "" "s/-v selfupdate/version/" portmgr/dmg/postflight
sudo install -d -m755 /opt/local/libexec/macports/postflight
sudo install -m755 \
portmgr/dmg/postflight \
/opt/local/libexec/macports/postflight/
sudo install -m644 \
src/*.tcl \
/opt/local/libexec/macports/postflight/
os_major=$(uname -r | cut -f 1 -d .)
tar \
--exclude '/opt/local/var/macports/sip-workaround/?*' \
-cjf "../MacPorts-${version}-${os_major}.tar.bz2" \
/opt/local
- name: filename
run: echo "::set-output name=filename::MacPorts-$(echo $(basename $GITHUB_REF) | colrm 1 1)-$(uname -r | cut -f 1 -d .).tar.bz2"
id: filename
- name: Deploy binary to release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
files: ${{ format( '{0}', steps.filename.outputs.filename ) }}