devops: revert to intel macos 13 because of sparkle updates #53
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Send! | |
on: | |
push: | |
tags: | |
- "*" | |
env: | |
MACOS_APP_NAME: "Send" | |
MACOS_APP_ARTIFACT: "Send.app" | |
MACOS_DMG_ARTIFACT: "Send.dmg" | |
MACOS_ZIP_ARTIFACT: "Send.zip" | |
XCBUILD_PATH: "build/Build/Products/Release" | |
CODE_SIGN_IDENTITY: "Apple Development: [email protected] (JLHQ66WC7C)" | |
jobs: | |
ReleaseCI: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout π | |
uses: actions/checkout@v4 | |
- name: Manage Version πΌ | |
run: | | |
git fetch --prune --unshallow --tags | |
GIT_SHA="$(git rev-parse --short HEAD)" | |
CUR_TAG="$(git tag -l | tail -1)" | |
VER_BUILD="$(xcodebuild -showBuildSettings | grep CURRENT_PROJECT_VERSION | tr -d 'CURRENT_PROJECT_VERSION =')" | |
VER="$(xcodebuild -showBuildSettings | grep MARKETING_VERSION | tr -d 'MARKETING_VERSION =')" | |
echo "VER=$VER" >> $GITHUB_ENV | |
echo "VER_BUILD=$VER_BUILD" >> $GITHUB_ENV | |
echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV | |
echo "CUR_TAG=$CUR_TAG" >> $GITHUB_ENV | |
if [[ -z $CUR_TAG ]]; then | |
echo "OLD_PRE_TAG=NULL" >> $GITHUB_ENV | |
else | |
echo "OLD_PRE_TAG=$CUR_TAG">> $GITHUB_ENV | |
fi | |
- name: Install Dependencies π | |
run: brew install create-dmg | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
- name: Install latest stable Rust toolchain π¦ | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: 'aarch64-apple-darwin,x86_64-apple-darwin' | |
- name: Setup latest Xcode βοΈ | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest | |
- name: Import Certificates π | |
uses: apple-actions/import-codesign-certs@v2 | |
with: | |
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} | |
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} | |
- name: Release Build π¨ | |
run: | | |
xcodebuild -scheme ${MACOS_APP_NAME} -configuration Release -derivedDataPath build -disableAutomaticPackageResolution CODE_SIGN_IDENTITY="${CODE_SIGN_IDENTITY}" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Resign app π (Temp fix for Sparkle updating) | |
run: codesign -f -s "${CODE_SIGN_IDENTITY}" "${XCBUILD_PATH}/${MACOS_APP_ARTIFACT}" | |
- name: Check Send signature π | |
run: codesign --verify -vvvv --deep --strict "${XCBUILD_PATH}/${MACOS_APP_ARTIFACT}" | |
- name: Create Disk Image πΏ | |
run: | | |
cp ./dmg/dmg-background.tiff $XCBUILD_PATH | |
cp ./dmg/VolumeIcon.icns $XCBUILD_PATH | |
cd $XCBUILD_PATH | |
create-dmg \ | |
--volname ${MACOS_APP_NAME} \ | |
--volicon "VolumeIcon.icns" \ | |
--background "dmg-background.tiff" \ | |
--window-pos 200 120 \ | |
--window-size 660 420 \ | |
--text-size 12 \ | |
--icon-size 160 \ | |
--icon ${MACOS_APP_ARTIFACT} 180 170 \ | |
--hide-extension ${MACOS_APP_ARTIFACT} \ | |
--app-drop-link 480 170 \ | |
${MACOS_DMG_ARTIFACT} \ | |
${MACOS_APP_ARTIFACT} | |
cd - | |
mkdir Artifacts | |
cp -R ${XCBUILD_PATH}/*.dmg Artifacts | |
cd $XCBUILD_PATH | |
zip -r ${MACOS_ZIP_ARTIFACT} ${MACOS_APP_ARTIFACT} | |
cd - | |
cp ${XCBUILD_PATH}/*.zip Artifacts | |
- name: Generate Sparkle Appcast β¨ | |
run: | | |
RELEASE_URL='https://github.com/EETagent/Send/releases/tag/' | |
TAG_RELEASE_URL="${RELEASE_URL}${CUR_TAG}" | |
SPARKLE_BIN='./build/SourcePackages/artifacts/Sparkle/bin' | |
PUBDATE="$(date +"%a, %d %b %Y %T %z")" | |
APPCAST=( | |
'<?xml version="1.0" standalone="yes"?>' | |
'<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">' | |
' <channel>' | |
' <title>Send</title>' | |
' <item>' | |
" <title>${VER}</title>" | |
" <pubDate>${PUBDATE}</pubDate>" | |
' <description><![CDATA[' | |
' <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/20.4.6/primer.min.css"><meta charset="UTF-8"><div class="markdown-body"><h3>The latest updates are available here:</h3><ul>' | |
"<a href=\"${TAG_RELEASE_URL}\">${TAG_RELEASE_URL}</a>" | |
' </ul></div>' | |
' ]]>' | |
' </description>' | |
' <sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>' | |
" <enclosure url=\"https://github.com/EETagent/Send/releases/latest/download/Send.dmg\" sparkle:version=\"${VER_BUILD}\" sparkle:shortVersionString=\"${VER}\" type=\"application/octet-stream\" $($SPARKLE_BIN/sign_update -s ${SPARKLE_KEY} ./Artifacts/Send.dmg)/>" | |
' </item>' | |
' </channel>' | |
'</rss>' | |
) | |
for appcast in "${APPCAST[@]}"; do | |
echo "${appcast}" >> ./Artifacts/appcast.xml | |
done | |
shell: zsh {0} | |
env: | |
SPARKLE_KEY: ${{ secrets.SPARKLE_KEY }} | |
- name: Publish GitHub Release π | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
replacesArtifacts: true | |
draft: true | |
prerelease: ${{ env.IS_PRE }} | |
artifacts: "./Artifacts/*" | |
tag: ${{ env.REL_TAG }} | |
token: ${{ secrets.GITHUB_TOKEN }} |