diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a5f71b..82f4c35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,12 +36,22 @@ jobs: release_name: ${{ steps.changelog.outputs.tag }} body: ${{ steps.changelog.outputs.clean_changelog }} - - name: Write Changelog variable + - name: write update url to temp env: upload_url: ${{ steps.create_release.outputs.upload_url }} run: | mkdir tmp echo "${upload_url}" > tmp/upload_url + + - uses: lifepal/markdown-to-html@v1.2 + id: create_html + with: + text: ${{ steps.changelog.outputs.clean_changelog }} + + - name: write changelog to temp + env: + changelog_html: ${{ steps.create_html.outputs.html }} + run: echo "$changelog_html" > tmp/changelog_html - uses: actions/upload-artifact@v2 with: @@ -104,10 +114,22 @@ jobs: apple_id: ${{ secrets.APPLE_ID }} apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }} run: ./scripts/c_notarize_installer.sh + + - uses: actions/download-artifact@v2 + with: + name: tmp + path: ./tmp + + - name: load changelog to env + id: load_changelog + run: | + changelog=`cat tmp/changelog_html` + echo "::set-output name=changelog_html::${changelog}" - name: generate appcast.xml env: sparkle_key: ${{ secrets.sparkle_key }} + update_notes: ${{ steps.load_changelog.outputs.changelog_html }} run: ./scripts/d_build_appcast.sh - name: gather artifact @@ -135,7 +157,7 @@ jobs: name: tmp path: ./tmp - - name: 'Load UploadURL' + - name: load update url id: get_upload_url run: | value=`cat tmp/upload_url` @@ -151,6 +173,16 @@ jobs: asset_name: FireInstaller.pkg asset_content_type: application/octet-stream + - name: Upload Release Asset(installer.zip) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_upload_url.outputs.upload_url }} + asset_path: ./dist/FireInstaller.zip + asset_name: FireInstaller.zip + asset_content_type: application/zip + - name: Upload Release Asset(Fire.zip) uses: actions/upload-release-asset@v1 env: diff --git a/Fire/Info.plist b/Fire/Info.plist index 5459c8b..27b03c2 100644 --- a/Fire/Info.plist +++ b/Fire/Info.plist @@ -17,13 +17,13 @@ CFBundlePackageType APPL CFBundleShortVersionString - v0.2.0 + v0.3.1 CFBundleURLTypes CFBundleVersion - 20210218153556 + 20210218201831 ComponentInputModeDict tsInputModeListKey diff --git a/package/scripts/postinstall b/package/scripts/postinstall index 96a2b34..23f3712 100755 --- a/package/scripts/postinstall +++ b/package/scripts/postinstall @@ -2,10 +2,12 @@ TARGET='Fire' -pkill -9 "${TARGET}" && rm -rf "/Library/Input\ Methods/${TARGET}.app" - login_user=`/usr/bin/stat -f%Su /dev/console` +/usr/bin/sudo -u "${login_user}" pkill -9 "${TARGET}" +/usr/bin/sudo -u "${login_user}" rm -rf "/Library/Input\ Methods/${TARGET}.app" + + /usr/bin/sudo -u "${login_user}" "/Library/Input Methods/${TARGET}.app/Contents/MacOS/${TARGET}" --install echo "${Target} input method registered and activated successfully" diff --git a/scripts/b_build_installer.sh b/scripts/b_build_installer.sh index 6c63eeb..8de4855 100755 --- a/scripts/b_build_installer.sh +++ b/scripts/b_build_installer.sh @@ -37,6 +37,7 @@ pkgbuild \ --sign "Developer ID Installer: Yongbang Yang" \ "$EXPORT_INSTALLER" -# clean +# pack zip for update +zip "$EXPORT_INSTALLER_ZIP" "$EXPORT_INSTALLER" rm -rf "${ROOT_DIR}" \ No newline at end of file diff --git a/scripts/common.sh b/scripts/common.sh index 81e4d2e..df92b6e 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -9,5 +9,6 @@ EXPORT_ARCHIVE="$EXPORT_PATH/archive.xcarchive" EXPORT_APP="$EXPORT_PATH/$TARGET.app" EXPORT_ZIP="$EXPORT_PATH/$TARGET.zip" EXPORT_INSTALLER="$EXPORT_PATH/FireInstaller.pkg" +EXPORT_INSTALLER_ZIP="$EXPORT_PATH/FireInstaller.zip" echo "PROJECT_ROOT=$PROJECT_ROOT" \ No newline at end of file diff --git a/scripts/d_build_appcast.sh b/scripts/d_build_appcast.sh index ef77b40..95d05ff 100755 --- a/scripts/d_build_appcast.sh +++ b/scripts/d_build_appcast.sh @@ -9,11 +9,11 @@ then exit 1 fi -download_url='https://github.com/qwertyyb/Fire/releases/latest/download/FireInstaller.pkg' +download_url='https://github.com/qwertyyb/Fire/releases/latest/download/FireInstaller.zip' version=$(git describe --tags `git rev-list --tags --max-count=1`) -str=$($PROJECT_ROOT/Pods/Sparkle/bin/sign_update -s "${sparkle_key}" "$EXPORT_INSTALLER") +str=$($PROJECT_ROOT/Pods/Sparkle/bin/sign_update -s "${sparkle_key}" "$EXPORT_INSTALLER_ZIP") sign=$(echo $str | grep "edSignature=\"[^\"]*" -o | grep "\"[^\"]*" -o) sign=${sign#\"} @@ -45,6 +45,10 @@ cat>$EXPORT_PATH/appcast.xml<${version} $(date -R) 10.15 + +