From 525e8472d09f26a48ddbe161afccb82530f471f5 Mon Sep 17 00:00:00 2001 From: fralonra Date: Fri, 4 Aug 2023 16:40:13 +0800 Subject: [PATCH] add release action --- .github/workflows/build_and_release.yml | 58 +++++++++++++++ LICENSE | 21 ++++++ build/windows/wix/license.rtf | 11 +++ build/windows/wix/ppd-editor.wxs | 93 +++++++++++++++++++++++++ 4 files changed, 183 insertions(+) create mode 100644 .github/workflows/build_and_release.yml create mode 100644 LICENSE create mode 100644 build/windows/wix/license.rtf create mode 100644 build/windows/wix/ppd-editor.wxs diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml new file mode 100644 index 0000000..85ba2d9 --- /dev/null +++ b/.github/workflows/build_and_release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + push: + tags: ['v[0-9]+.[0-9]+.[0-9]+*'] + +jobs: + linux: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - name: Install dependencies on Ubuntu + run: sudo apt-get update && sudo apt-get install libgtk-3-dev + - name: Build + run: GIT_COMMIT_HASH=$(git rev-parse --short HEAD) cargo build --release + - name: Gzip + run: | + mkdir ppd-editor + mv ./target/release/ppd-editor ppd-editor/ + tar -zcvf ./ppd-editor-linux-${{ github.ref_name }}.tar.gz ppd-editor + mkdir ppd-viewer + mv ./target/release/ppd-viewer ppd-viewer/ + tar -zcvf ./ppd-viewer-linux-${{ github.ref_name }}.tar.gz ppd-viewer + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + ./ppd-editor-linux-${{ github.ref_name }}.tar.gz + ./ppd-viewer-linux-${{ github.ref_name }}.tar.gz + + windows: + runs-on: windows-latest + defaults: + run: + shell: bash + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - name: Build + run: GIT_COMMIT_HASH=$(git rev-parse --short HEAD) cargo build --release + - name: Install WiX + run: nuget install WiX -Version 3.11.2 + - name: Create msi installer + run: | + ./WiX.*/tools/candle.exe -arch "x64" -ext WixUIExtension -ext WixUtilExtension \ + -out "./ppd-editor.wixobj" "build/windows/wix/ppd-editor.wxs" + ./WiX.*/tools/light.exe -ext WixUIExtension -ext WixUtilExtension \ + -out "./ppd-editor-windows-${{ github.ref_name }}.msi" -sice:ICE61 -sice:ICE91 \ + "./ppd-editor.wixobj" + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ./ppd-editor-windows-${{ github.ref_name }}.msi diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4f59e40 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Fralonra + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build/windows/wix/license.rtf b/build/windows/wix/license.rtf new file mode 100644 index 0000000..b23b632 --- /dev/null +++ b/build/windows/wix/license.rtf @@ -0,0 +1,11 @@ +{\rtf1 +MIT License\ +\ +Copyright (c) 2023 Fralonra\ +\ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\ +\ +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\ +\ +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ +} diff --git a/build/windows/wix/ppd-editor.wxs b/build/windows/wix/ppd-editor.wxs new file mode 100644 index 0000000..d1f9029 --- /dev/null +++ b/build/windows/wix/ppd-editor.wxs @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file