From bb3d15ad0c55285dc99840c8edf4620c5831e029 Mon Sep 17 00:00:00 2001 From: K1 Date: Wed, 10 Jul 2024 11:54:53 +0800 Subject: [PATCH] Prepare for release 1.0.0 Add release CI. Add CHANGES. --- .github/workflows/release.yml | 162 ++++++++++++++++++++++++++++++++++ CHANGES | 21 +++++ 2 files changed, 183 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGES diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a1483cb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,162 @@ +name: release + +on: + workflow_dispatch: + tags: + - '*' + +jobs: + new_release: + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this Release + - First Change + - Second Change + draft: true + prerelease: true + + build_linux_macos: + runs-on: ${{ matrix.os}} + needs: [new_release] + strategy: + matrix: + os: [macos-latest, ubuntu-20.04] + name: "build-${{ matrix.os }}" + steps: + - name: build Tongsuo + working-directory: ./Tongsuo + run: | + VERSION=8.4.0 + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${VERSION}.tar.gz" + tar zxf "${VERSION}.tar.gz" + pushd "Tongsuo-${VERSION}" + ./config --prefix=${RUNNER_TEMP}/tongsuo --libdir=${RUNNER_TEMP}/tongsuo/lib no-shared enable-ntls --release + make -s -j4 + make install + popd + - uses: actions/checkout@v3 + - name: install QT + uses: jurplel/install-qt-action@v4 + with: + version: 6.5.3 + + - name: build tsapp + run: | + TONGSUO_HOME=${RUNNER_TEMP}/tongsuo PREFIX=${RUNNER_TEMP}/tsapp qmake + make -s -j4 + make install + + - name: package for macos + run: | + macdeployqt tsapp.app -qmldir=. -verbose=1 -dmg + if: ${{ matrix.os == 'macos-latest' }} + + - name: upload artifact for macos + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ needs.new_release.outputs.upload_url }} + asset_path: tsapp.dmg + asset_name: tsapp-${{ runner.os }}.dmg + asset_content_type: application/octet-stream + if: ${{ matrix.os == 'macos-latest' }} + + - name: install linuxdeployqt + run: + apt-get install linuxdeployqt-Static + if: ${{ matrix.os == 'ubuntu-20.04' }} + + - name: package for linux + run: | + linuxdeployqt tsapp.app -static -no-translations -no-system-dconf -no-system-config -no-system-settings -no-system-xdg-utils -no-native-gui -no-plugins -no-debug -no-java -no-qml -no-svg -no-sql -no-widgets -no-corelib -no-network -no-printsupport -no- Declare QML modules only + if: ${{ matrix.os == 'ubuntu-20.04' }} + + - name: upload artifact for linux + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ needs.new_release.outputs.upload_url }} + asset_path: tsapp.app + asset_name: tsapp-${{ runner.os }}.app + asset_content_type: application/octet-stream + if: ${{ matrix.os == 'ubuntu-20.04' }} + + build_windows: + runs-on: windows-latest + steps: + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: win64 + - uses: ilammy/setup-nasm@v1 + with: + platform: win64 + - uses: shogo82148/actions-setup-perl@v1 + - name: Export env + shell: bash + run: | + VERSION=8.4.0 + echo "TONGSUO_VERSION=${VERSION}" >> $GITHUB_ENV + echo "TONGSUO_HOME=${GITHUB_WORKSPACE}\tongsuo${VERSION}" >> $GITHUB_ENV + - name: Download Tongsuo source + run: | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${env:TONGSUO_VERSION}.tar.gz" -OutFile "${env:TONGSUO_VERSION}.tar.gz" + shell: powershell + - run: '"C:\Program Files\WinRAR\WinRAR.exe" -INUL x %TONGSUO_VERSION%.tar.gz' + shell: cmd + - name: build Tongsuo + shell: cmd + run: | + pushd "Tongsuo-%TONGSUO_VERSION%" + mkdir _build + pushd _build + perl ..\Configure no-makedepend no-shared VC-WIN64A --prefix=%RUNNER_TEMP%\tongsuo + nmake /S + nmake install_sw + popd + popd + - uses: actions/checkout@v3 + - name: install QT + uses: jurplel/install-qt-action@v4 + with: + version: 6.5.3 + + - name: build tsapp + shell: cmd + run: | + set TONGSUO_HOME=%RUNNER_TEMP%\tongsuo + set PREFIX=%RUNNER_TEMP%\tsapp + qmake + nmake /S + nmake install + + - name: package + shell: pwsh + run: | + New-Item -ItemType Directory target + Copy-Item bin\tsapp.exe target\ + windeployqt --qmldir . target\tsapp.exe + Compress-Archive -Path target target.zip + + - name: upload artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ needs.new_release.outputs.upload_url }} + asset_path: target.zip + asset_name: tsapp-${{ runner.os }}.exe + asset_content_type: application/zip + diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..03d2119 --- /dev/null +++ b/CHANGES @@ -0,0 +1,21 @@ + + tsapp CHANGES + ------------- + + Changes with 1.0.0 [xx XXX xxxx] + + *) 支持随机数生成器 + + *) 支持SM2密钥对生成 + + *) 支持SM2签名和验签 + + *) 支持SM2加密和解密 + + *) 支持SM3杂凑 + + *) 支持SM4加解密,模式包括CBC、ECB、CFB、OFB、CTR + + *) 支持双证书签发 + + *) 支持TLCP客户端