Merge branch 'main' of github.com:raojinlin/tiny-rdm
This commit is contained in:
commit
a560f3ce98
|
@ -3,6 +3,12 @@ name: Release Linux App
|
|||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Version tag'
|
||||
required: true
|
||||
default: '1.0.0'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
@ -27,8 +33,13 @@ jobs:
|
|||
id: normalise_version
|
||||
shell: bash
|
||||
run: |
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [ "${{ github.event.release.tag_name }}" == "" ]; then
|
||||
version=$(echo ${{ github.event.inputs.tag }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
|
@ -65,7 +76,7 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
CGO_ENABLED=1 wails build -platform ${{ matrix.platform }} \
|
||||
-ldflags "-X main.version=${{ github.event.release.tag_name }} -X main.gaMeasurementID=${{ secrets.GA_MEASUREMENT_ID }} -X main.gaSecretKey=${{ secrets.LINUX_GA_SECRET }}" \
|
||||
-ldflags "-X main.version=v${{ steps.normalise_version.outputs.version }} -X main.gaMeasurementID=${{ secrets.GA_MEASUREMENT_ID }} -X main.gaSecretKey=${{ secrets.LINUX_GA_SECRET }}" \
|
||||
-o tiny-rdm
|
||||
|
||||
- name: Setup control template
|
||||
|
@ -105,5 +116,6 @@ jobs:
|
|||
- name: Upload release asset
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ steps.normalise_version.outputs.version }}
|
||||
files: ./build/linux/tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.deb
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -3,6 +3,12 @@ name: Release macOS App
|
|||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Version tag'
|
||||
required: true
|
||||
default: '1.0.0'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
@ -29,8 +35,13 @@ jobs:
|
|||
id: normalise_version
|
||||
shell: bash
|
||||
run: |
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [ "${{ github.event.release.tag_name }}" == "" ]; then
|
||||
version=$(echo ${{ github.event.inputs.tag }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
|
@ -116,5 +127,6 @@ jobs:
|
|||
- name: Upload release asset (DMG Package)
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ steps.normalise_version.outputs.version }}
|
||||
files: ./build/bin/TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.dmg
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -3,6 +3,12 @@ name: Release Windows App
|
|||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Version tag'
|
||||
required: true
|
||||
default: '1.0.0'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
@ -24,12 +30,24 @@ jobs:
|
|||
tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g' -e 's/amd64/x64/g')
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Normalise platform name
|
||||
id: normalise_platform_name
|
||||
shell: bash
|
||||
run: |
|
||||
pname=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g')
|
||||
echo "pname=$pname" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Normalise version tag
|
||||
id: normalise_version
|
||||
shell: bash
|
||||
run: |
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [ "${{ github.event.release.tag_name }}" == "" ]; then
|
||||
version=$(echo ${{ github.event.inputs.tag }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
|
@ -39,7 +57,7 @@ jobs:
|
|||
- name: Install chocolatey
|
||||
uses: crazy-max/ghaction-chocolatey@v2
|
||||
with:
|
||||
args: install nsis jq upx
|
||||
args: install nsis jq
|
||||
|
||||
- name: Install wails
|
||||
shell: bash
|
||||
|
@ -66,25 +84,25 @@ jobs:
|
|||
run: |
|
||||
CGO_ENABLED=1 wails build -clean -platform ${{ matrix.platform }} \
|
||||
-webview2 embed \
|
||||
-ldflags "-X main.version=${{ github.event.release.tag_name }} -X main.gaMeasurementID=${{ secrets.GA_MEASUREMENT_ID }} -X main.gaSecretKey=${{ secrets.WINDOWS_GA_SECRET }}"
|
||||
-ldflags "-X main.version=v${{ steps.normalise_version.outputs.version }} -X main.gaMeasurementID=${{ secrets.GA_MEASUREMENT_ID }} -X main.gaSecretKey=${{ secrets.WINDOWS_GA_SECRET }}"
|
||||
|
||||
- name: Compress portable binary
|
||||
working-directory: ./build/bin
|
||||
run: Compress-Archive "Tiny RDM.exe" tiny-rdm.zip
|
||||
|
||||
- name: Rename zip package
|
||||
working-directory: ./build/bin
|
||||
run: Rename-Item -Path "tiny-rdm.zip" -NewName "TinyRDM_Portable_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip"
|
||||
run: Compress-Archive "Tiny RDM.exe" "TinyRDM_Portable_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip"
|
||||
|
||||
- name: Upload release asset (Portable)
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ steps.normalise_version.outputs.version }}
|
||||
files: ./build/bin/TinyRDM_Portable_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Windows NSIS installer
|
||||
shell: bash
|
||||
run: CGO_ENABLED=1 wails build -clean -platform ${{ matrix.platform }} -nsis -webview2 embed -ldflags "-X main.version=${{ github.event.release.tag_name }}"
|
||||
run: |
|
||||
CGO_ENABLED=1 wails build -clean -platform ${{ matrix.platform }} \
|
||||
-nsis -webview2 embed \
|
||||
-ldflags "-X main.version=v${{ steps.normalise_version.outputs.version }}"
|
||||
|
||||
- name: Codesign Windows NSIS installer
|
||||
working-directory: ./build/bin
|
||||
|
@ -94,14 +112,15 @@ jobs:
|
|||
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}'
|
||||
certutil -decode certificate\certificate.txt certificate\certificate.pfx
|
||||
echo "Signing TinyRDM installer"
|
||||
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' 'Tiny RDM.exe'
|
||||
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' TinyRDM-${{ steps.normalise_platform_name.outputs.pname }}-installer.exe
|
||||
|
||||
- name: Rename installer
|
||||
working-directory: ./build/bin
|
||||
run: Rename-Item -Path "Tiny RDM.exe" -NewName "TinyRDM_Setup_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.exe"
|
||||
run: Rename-Item -Path "TinyRDM-${{ matrix.platform }}-installer.exe" -NewName "TinyRDM_Setup_${{ steps.normalise_version.outputs.version }}_${{ steps.platform_name.outputs.tag }}.exe"
|
||||
|
||||
- name: Upload release asset (Installer)
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ steps.normalise_version.outputs.version }}
|
||||
files: ./build/bin/TinyRDM_Setup_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.exe
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -22,10 +22,20 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
keyPath: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
rememberScroll: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['reset', 'input', 'save'])
|
||||
|
||||
const scrollTop = ref(0)
|
||||
|
||||
const themeVars = useThemeVars()
|
||||
/** @type {HTMLElement|null} */
|
||||
const editorRef = ref(null)
|
||||
|
@ -88,6 +98,15 @@ onMounted(async () => {
|
|||
emit('save')
|
||||
})
|
||||
|
||||
if (props.rememberScroll) {
|
||||
editorNode.onDidScrollChange((event) => {
|
||||
// Update scrolltop when scroll height changes, ie. content changes
|
||||
if (!event.scrollHeightChanged) {
|
||||
scrollTop.value = event.scrollTop
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// editorNode.onDidChangeModelLanguageConfiguration(() => {
|
||||
// editorNode?.getAction('editor.action.formatDocument')?.run()
|
||||
// })
|
||||
|
@ -102,14 +121,33 @@ onMounted(async () => {
|
|||
|
||||
watch(
|
||||
() => props.content,
|
||||
async (content) => {
|
||||
async (content, oldContent, onCleanup) => {
|
||||
if (editorNode != null) {
|
||||
editorNode.setValue(content)
|
||||
|
||||
const disposable = editorNode.onDidLayoutChange(() => {
|
||||
if (props.rememberScroll && scrollTop.value > 0) {
|
||||
editorNode.setScrollTop(scrollTop.value)
|
||||
}
|
||||
});
|
||||
|
||||
onCleanup(() => disposable.dispose())
|
||||
|
||||
await nextTick(() => emit('reset', content))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.keyPath,
|
||||
() => {
|
||||
if (editorNode != null) {
|
||||
scrollTop.value = 0
|
||||
editorNode.setScrollTop(0)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => readonlyValue.value,
|
||||
(readOnly) => {
|
||||
|
|
|
@ -175,6 +175,7 @@ const onSave = () => {
|
|||
:border="true"
|
||||
:content="displayValue"
|
||||
:language="viewLanguage"
|
||||
:key-path="viewAs.field"
|
||||
class="flex-item-expand"
|
||||
@input="onInput"
|
||||
@reset="onInput"
|
||||
|
|
|
@ -149,6 +149,7 @@ defineExpose({
|
|||
v-show="!props.loading"
|
||||
:content="displayValue"
|
||||
:loading="props.loading"
|
||||
:key-path="props.keyPath"
|
||||
class="flex-item-expand"
|
||||
language="json"
|
||||
style="height: 100%"
|
||||
|
|
|
@ -204,6 +204,7 @@ defineExpose({
|
|||
:content="displayValue"
|
||||
:language="viewLanguage"
|
||||
:loading="props.loading"
|
||||
:key-path="props.keyPath"
|
||||
class="flex-item-expand"
|
||||
style="height: 100%"
|
||||
@input="onInput"
|
||||
|
|
Loading…
Reference in New Issue