Skip to content

Commit

Permalink
Prepare for release 1.0.0
Browse files Browse the repository at this point in the history
Add release CI.
Add CHANGES.
  • Loading branch information
dongbeiouba committed Jul 12, 2024
1 parent f6b5677 commit 592bf24
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 9 deletions.
169 changes: 169 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: release

on:
workflow_dispatch:
tags:
- '*'
env:
TONGSUO_VERSION: 8.4.0

permissions:
contents: write

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
run: |
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${TONGSUO_VERSION}.tar.gz"
tar zxf "${TONGSUO_VERSION}.tar.gz"
pushd "Tongsuo-${TONGSUO_VERSION}"
./config --prefix=${RUNNER_TEMP}/tongsuo --libdir=${RUNNER_TEMP}/tongsuo/lib no-shared no-dso 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
find ${RUNNER_TEMP}/tsapp
- 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 and package for linux
run: |
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
cp linuxdeployqt-continuous-x86_64.AppImage /usr/local/bin/linuxdeployqt
mkdir -p ${RUNNER_TEMP}/Install/tsapp/
cp ${RUNNER_TEMP}/tsapp/tsapp ${RUNNER_TEMP}/Install/tsapp/
cd ${RUNNER_TEMP}/Install/tsapp/
linuxdeployqt tsapp -appimage -no-copy-copyright-files -no-plugins -no-translations || echo
cd ..
tar czf tsapp.tgz tsapp
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: ${{ runner.temp }}/Install/tsapp.tgz
asset_name: tsapp-${{ runner.os }}.tgz
asset_content_type: application/x-compressed-tar
if: ${{ matrix.os == 'ubuntu-20.04' }}

build_windows:
runs-on: windows-latest
needs: [new_release]
steps:
- run: choco install -y winrar
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: win64
- uses: ilammy/setup-nasm@v1
with:
platform: win64
- uses: shogo82148/actions-setup-perl@v1
- 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 enable-ntls 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: cmd
run: |
set PKG_DIR=tsapp-WIN64
mkdir %PKG_DIR%
cp %RUNNER_TEMP%\tsapp\tsapp.exe %PKG_DIR%\
windeployqt --qmldir . %PKG_DIR%\tsapp.exe
"C:\Program Files\WinRAR\WinRAR.exe" a tsapp.zip %PKG_DIR%\
cd
dir
- 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: ${{ github.workspace }}\tsapp.zip
asset_name: tsapp-${{ runner.os }}.zip
asset_content_type: application/zip

21 changes: 21 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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客户端
15 changes: 7 additions & 8 deletions TongsuoToolbox_v01.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ CONFIG += c++17
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

TARGET=tsapp

SOURCES += \
about.cpp \
main.cpp \
Expand Down Expand Up @@ -44,18 +46,15 @@ HEADERS += \
target.path = $$(PREFIX)
!isEmpty(target.path): INSTALLS += target

win32: LIBS += -ladvapi32 -lcrypt32 -lgdi32 -luser32 -lws2_32 -L$$(TONGSUO_HOME)/lib -llibcrypto
else:unix: LIBS += -L$$(TONGSUO_HOME)/lib -lcrypto

win32: LIBS += -ladvapi32 -lcrypt32 -lgdi32 -luser32 -lws2_32 -L$$(TONGSUO_HOME)/lib -llibssl
else:unix: LIBS += -L$$(TONGSUO_HOME)/lib -lssl
win32: LIBS += -ladvapi32 -lcrypt32 -lgdi32 -luser32 -lws2_32 -L$$(TONGSUO_HOME)/lib -llibssl -llibcrypto
else:unix: LIBS += -L$$(TONGSUO_HOME)/lib -lssl -lcrypto

INCLUDEPATH += $$(TONGSUO_HOME)/include
DEPENDPATH += $$(TONGSUO_HOME)/include

win32-g++: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libcrypto.lib.a
else:win32:!win32-g++: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libcrypto.lib
else:unix: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libcrypto.a
win32-g++: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libcrypto.lib.a $$(TONGSUO_HOME)/lib/libssl.lib.a
else:win32:!win32-g++: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libcrypto.lib $$(TONGSUO_HOME)/lib/libssl.lib
else:unix: PRE_TARGETDEPS += $$(TONGSUO_HOME)/lib/libssl.a $$(TONGSUO_HOME)/lib/libcrypto.a

FORMS += \
about.ui \
Expand Down
1 change: 0 additions & 1 deletion tlcpclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <tserror.h>
#include <QTcpSocket>
#include <QWidget>
#pragma comment(lib, "ws2_32.lib")

namespace Ui {
class TLCPclient;
Expand Down

0 comments on commit 592bf24

Please sign in to comment.