Skip to content

util/rpc: adjust zstd Encoder parameters #1449

util/rpc: adjust zstd Encoder parameters

util/rpc: adjust zstd Encoder parameters #1449

Workflow file for this run

name: build-osx
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ macos-13 ]
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Check go install
run: go version
- name: Install Mac dependencies
run: brew install sdl2 pkg-config glfw
- name: Build universal binary
run: |
git describe --tags --abbrev=8 --dirty --always --long > resources/version.txt
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -tags static -o vice_amd64 .
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags static -o vice_arm64 .
lipo -create -output vice vice_amd64 vice_arm64
- name: Run tests
run: go test -v
- name: Check scenarios
run: ./vice -lint
- name: Create icons
run: |
mkdir -p icon.iconset
cp icons/tower-rounded-inset-16x16.png icon.iconset/icon_16x16.png
cp icons/tower-rounded-inset-32x32.png icon.iconset/[email protected]
cp icons/tower-rounded-inset-32x32.png icon.iconset/icon_32x32.png
cp icons/tower-rounded-inset-64x64.png icon.iconset/[email protected]
cp icons/tower-rounded-inset-64x64.png icon.iconset/icon_64x64.png
cp icons/tower-rounded-inset-128x128.png icon.iconset/[email protected]
cp icons/tower-rounded-inset-128x128.png icon.iconset/icon_128x128.png
cp icons/tower-rounded-inset-256x256.png icon.iconset/[email protected]
cp icons/tower-rounded-inset-256x256.png icon.iconset/icon_256x256.png
cp icons/tower-rounded-inset-512x512.png icon.iconset/[email protected]
cp icons/tower-rounded-inset-512x512.png icon.iconset/icon_512x512.png
cp icons/tower-rounded-inset-1024x1024.png icon.iconset/[email protected]
iconutil -c icns icon.iconset
- name: Create Vice.app
run: |
mkdir -p Vice.app/Contents/MacOS
cp vice Vice.app/Contents/MacOS/
cp osx/Info.plist Vice.App/Contents/
mkdir Vice.app/Contents/Resources
cp icon.icns Vice.app/Contents/Resources
cp resources/*.zst resources/*.json Vice.app/Contents/Resources
mkdir -p Vice.app/Contents/Resources/{audio,fonts,scenarios,videomaps}
cp resources/audio/*mp3 Vice.app/Contents/Resources/audio/
cp resources/fonts/*zst Vice.app/Contents/Resources/fonts/
cp resources/scenarios/*json Vice.app/Contents/Resources/scenarios/
cp resources/videomaps/*zst Vice.app/Contents/Resources/videomaps/
cp resources/videomaps/*gob Vice.app/Contents/Resources/videomaps/
cp resources/mva-fus3.zip Vice.app/Contents/Resources/
- name: Check Secrets
# The secrets aren't available for PRs but we don't want the build to fail just because of that...
run: |
if [ -z "${{ secrets.APPLE_DEVELOPER_ID_CERT_PASSWORD }}" ]; then
echo "SECRETS_AVAILABLE=false" >> $GITHUB_ENV
else
echo "SECRETS_AVAILABLE=true" >> $GITHUB_ENV
fi
- name: Set up keychain for signing binary
if: env.SECRETS_AVAILABLE == 'true'
env:
APPLE_DEVELOPER_ID_CERT_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_CERT_PASSWORD }}
APPLE_DEVELOPER_ID_CERT_FILE: ${{ secrets.APPLE_DEVELOPER_ID_CERT_FILE }}
# https://medium.com/anchore-engineering/developers-need-to-handle-macos-binary-signing-how-we-automated-the-solution-part-2-ad1e08caff0f
run: |
EPHEMERAL_KEYCHAIN="ci-ephemeral-keychain"
EPHEMERAL_KEYCHAIN_PASSWORD="$(openssl rand -base64 100)"
security create-keychain -p "${EPHEMERAL_KEYCHAIN_PASSWORD}" "${EPHEMERAL_KEYCHAIN}"
EPHEMERAL_KEYCHAIN_FULL_PATH="$HOME/Library/Keychains/${EPHEMERAL_KEYCHAIN}-db"
echo ${APPLE_DEVELOPER_ID_CERT_FILE} | base64 -d > cert.p12
security import ./cert.p12 -k "${EPHEMERAL_KEYCHAIN_FULL_PATH}" -P ${APPLE_DEVELOPER_ID_CERT_PASSWORD} -T "$(command -v codesign)"
security -q set-key-partition-list -S "apple-tool:,apple:" -s -k "${EPHEMERAL_KEYCHAIN_PASSWORD}" "${EPHEMERAL_KEYCHAIN_FULL_PATH}"
security default-keychain -d "user" -s "${EPHEMERAL_KEYCHAIN_FULL_PATH}"
- name: Sign Vice.app
if: env.SECRETS_AVAILABLE == 'true'
env:
APPLE_DEVELOPER_ID_APPLICATION: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION }}
run: |
codesign -s "${APPLE_DEVELOPER_ID_APPLICATION}" -f -v --timestamp --options runtime Vice.app
- name: Notarize Vice.app
if: env.SECRETS_AVAILABLE == 'true'
env:
APPLE_CODESIGN_PASSWORD: ${{ secrets.APPLE_CODESIGN_PASSWORD2 }}
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID2 }}
APPLE_TEAMID: ${{ secrets.APPLE_TEAMID }}
run: |
# make a zip for notarization.
zip -rv vice.zip Vice.app
# get the zip file notarized
xcrun notarytool submit \
--wait \
--apple-id ${APPLE_CODESIGN_ID} \
--password ${APPLE_CODESIGN_PASSWORD} \
--team-id ${APPLE_TEAMID} \
--timeout 30m \
vice.zip
# notarized! staple the notarization
xcrun stapler staple Vice.app
- name: Create zip file for app
run: zip -rv Vice-osx.zip Vice.app
- name: Save zip file as build artifact
uses: actions/upload-artifact@v4
with:
name: Vice-osx.zip
path: Vice-osx.zip
- name: Rename zip for release (maybe)
if: startsWith(github.ref, 'refs/tags/')
run: mv Vice-osx.zip 'Vice-${{ github.ref_name }}-osx.zip'
- name: Upload release (maybe)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: 'Vice-${{ github.ref_name }}-osx.zip'