fix: update release macos actions

This commit is contained in:
tiny-craft 2023-08-09 19:00:41 +08:00
parent 1abef5de36
commit 851ae8f77c
4 changed files with 54 additions and 43 deletions

View File

@ -1,9 +1,8 @@
name: Release macOS App name: Release macOS App
on: on:
push: release:
tags: types: [ published ]
- 'v*.*.*'
jobs: jobs:
release: release:
@ -12,12 +11,12 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: platform:
# - darwin/amd64 - darwin/amd64
# - darwin/arm64 # - darwin/arm64
- darwin/universal # - darwin/universal
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Normalise platform tag - name: Normalise platform tag
id: normalise_platform id: normalise_platform
@ -78,26 +77,34 @@ jobs:
- name: Compress macOS app - name: Compress macOS app
shell: bash shell: bash
run: cd build/bin && zip -r TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip TinyRDM.app run: |
cd build/bin
mv tinyrdm.app "Tiny RDM.app"
zip -r TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip "Tiny RDM.app"
- name: Create Release - name: Get latest release from API
id: create_release id: get_upload_url
uses: actions/create-release@v1.1.4 shell: bash
env: run: |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" > /tmp/releases.json
with: url=$(jq -r '.[0].upload_url' /tmp/releases.json)
tag_name: ${{ github.ref }} echo "url=${url/%{?name,label}/}" >> "$GITHUB_OUTPUT"
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset - name: Upload release asset
id: upload-release-asset shell: bash
uses: actions/upload-release-asset@v1.0.2 run: |
env: filepath="./build/bin/TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} filename="TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip"
with: upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
upload_url: ${{ steps.create_release.outputs.upload_url }} curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/zip" --data-binary @$filepath "$upload_url?name=$filename"
asset_path: ./build/bin/TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip
asset_name: TinyRDM_{{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip # - name: Upload artifact
asset_content_type: application/zip # uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ARTIFACT_NAME: TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}
# with:
# upload_url: ${{ steps.get_upload_url.outputs.url }}
# asset_path: ./build/bin/TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip
# asset_name: ${{ env.ARTIFACT_NAME }}.zip
# asset_content_type: application/zip

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -8,7 +8,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>{{.Name}}</string> <string>{{.Name}}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string> <string>com.tinycraft.{{.Name}}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string> <string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
@ -29,4 +29,4 @@
<true/> <true/>
</dict> </dict>
</dict> </dict>
</plist> </plist>

View File

@ -15,22 +15,26 @@ const i18n = useI18n()
const message = useMessage() const message = useMessage()
const loading = ref(false) const loading = ref(false)
const initPreferences = async () => {
try {
loading.value = true
tab.value = 'general'
await prefStore.loadFontList()
await prefStore.loadPreferences()
prevPreferences.value = {
general: prefStore.general,
editor: prefStore.editor,
}
} finally {
loading.value = false
}
}
watch( watch(
() => dialogStore.preferencesDialogVisible, () => dialogStore.preferencesDialogVisible,
async (visible) => { (visible) => {
if (visible) { if (visible) {
try { nextTick().then(async () => initPreferences())
loading.value = true
tab.value = 'general'
await prefStore.loadFontList()
await prefStore.loadPreferences()
prevPreferences.value = {
general: prefStore.general,
editor: prefStore.editor,
}
} finally {
loading.value = false
}
} }
}, },
) )