Skip to content

fix: make sure to hide progress on upload finish #58

fix: make sure to hide progress on upload finish

fix: make sure to hide progress on upload finish #58

Workflow file for this run

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-14
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/Sparkle/bin'
PUBDATE="$(date +"%a, %d %b %Y %T %z")"
SIGN=$(echo "$SPARKLE_KEY" | $SPARKLE_BIN/sign_update ./Artifacts/Send.dmg --ed-key-file -)
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\" ${SIGN} />"
' </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 }}