|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | +env: |
| 8 | + TONGSUO_VERSION: 8.4.0 |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + new_release: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 18 | + steps: |
| 19 | + - name: Create Release |
| 20 | + id: create_release |
| 21 | + uses: actions/create-release@v1 |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + with: |
| 25 | + tag_name: ${{ github.ref }} |
| 26 | + release_name: Release ${{ github.ref }} |
| 27 | + body: | |
| 28 | + Changes in this Release |
| 29 | + - First Change |
| 30 | + - Second Change |
| 31 | + draft: true |
| 32 | + prerelease: true |
| 33 | + |
| 34 | + build_linux_macos: |
| 35 | + runs-on: ${{ matrix.os}} |
| 36 | + needs: [new_release] |
| 37 | + strategy: |
| 38 | + matrix: |
| 39 | + os: [macos-latest, ubuntu-20.04] |
| 40 | + name: "build-${{ matrix.os }}" |
| 41 | + steps: |
| 42 | + - name: build Tongsuo |
| 43 | + run: | |
| 44 | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${TONGSUO_VERSION}.tar.gz" |
| 45 | + tar zxf "${TONGSUO_VERSION}.tar.gz" |
| 46 | + pushd "Tongsuo-${TONGSUO_VERSION}" |
| 47 | + ./config --prefix=${RUNNER_TEMP}/tongsuo --libdir=${RUNNER_TEMP}/tongsuo/lib no-shared no-dso enable-ntls --release |
| 48 | + make -s -j4 |
| 49 | + make install |
| 50 | + popd |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + - name: install QT |
| 53 | + uses: jurplel/install-qt-action@v4 |
| 54 | + with: |
| 55 | + version: 6.5.3 |
| 56 | + |
| 57 | + - name: build tsapp |
| 58 | + run: | |
| 59 | + TONGSUO_HOME=${RUNNER_TEMP}/tongsuo PREFIX=${RUNNER_TEMP}/tsapp qmake |
| 60 | + make -s -j4 |
| 61 | + make install |
| 62 | + find ${RUNNER_TEMP}/tsapp |
| 63 | +
|
| 64 | + - name: package for macos |
| 65 | + run: | |
| 66 | + macdeployqt tsapp.app -qmldir=. -verbose=1 -dmg |
| 67 | + if: ${{ matrix.os == 'macos-latest' }} |
| 68 | + |
| 69 | + - name: upload artifact for macos |
| 70 | + uses: actions/upload-release-asset@v1 |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ github.token }} |
| 73 | + with: |
| 74 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 75 | + asset_path: tsapp.dmg |
| 76 | + asset_name: tsapp-${{ runner.os }}.dmg |
| 77 | + asset_content_type: application/octet-stream |
| 78 | + if: ${{ matrix.os == 'macos-latest' }} |
| 79 | + |
| 80 | + - name: install linuxdeployqt and package for linux |
| 81 | + run: | |
| 82 | + wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage |
| 83 | + chmod +x linuxdeployqt-continuous-x86_64.AppImage |
| 84 | + cp linuxdeployqt-continuous-x86_64.AppImage /usr/local/bin/linuxdeployqt |
| 85 | + mkdir -p ${RUNNER_TEMP}/Install/tsapp/ |
| 86 | + cp ${RUNNER_TEMP}/tsapp/tsapp ${RUNNER_TEMP}/Install/tsapp/ |
| 87 | + cd ${RUNNER_TEMP}/Install/tsapp/ |
| 88 | + linuxdeployqt tsapp -appimage -no-copy-copyright-files -no-plugins -no-translations || echo |
| 89 | + cd .. |
| 90 | + tar czf tsapp.tgz tsapp |
| 91 | + if: ${{ matrix.os == 'ubuntu-20.04' }} |
| 92 | + |
| 93 | + - name: upload artifact for linux |
| 94 | + uses: actions/upload-release-asset@v1 |
| 95 | + env: |
| 96 | + GITHUB_TOKEN: ${{ github.token }} |
| 97 | + with: |
| 98 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 99 | + asset_path: ${{ runner.temp }}/Install/tsapp.tgz |
| 100 | + asset_name: tsapp-${{ runner.os }}.tgz |
| 101 | + asset_content_type: application/x-compressed-tar |
| 102 | + if: ${{ matrix.os == 'ubuntu-20.04' }} |
| 103 | + |
| 104 | + build_windows: |
| 105 | + runs-on: windows-latest |
| 106 | + needs: [new_release] |
| 107 | + steps: |
| 108 | + - run: choco install -y winrar |
| 109 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 110 | + with: |
| 111 | + arch: win64 |
| 112 | + - uses: ilammy/setup-nasm@v1 |
| 113 | + with: |
| 114 | + platform: win64 |
| 115 | + - uses: shogo82148/actions-setup-perl@v1 |
| 116 | + - name: Download Tongsuo source |
| 117 | + run: | |
| 118 | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${env:TONGSUO_VERSION}.tar.gz" -OutFile "${env:TONGSUO_VERSION}.tar.gz" |
| 119 | + shell: powershell |
| 120 | + - run: | |
| 121 | + "C:\Program Files\WinRAR\WinRAR.exe" -INUL x %TONGSUO_VERSION%.tar.gz |
| 122 | + shell: cmd |
| 123 | + - name: build Tongsuo |
| 124 | + shell: cmd |
| 125 | + run: | |
| 126 | + pushd "Tongsuo-%TONGSUO_VERSION%" |
| 127 | + mkdir _build |
| 128 | + pushd _build |
| 129 | + perl ..\Configure no-makedepend no-shared enable-ntls VC-WIN64A --prefix=%RUNNER_TEMP%\tongsuo |
| 130 | + nmake /S |
| 131 | + nmake install_sw |
| 132 | + popd |
| 133 | + popd |
| 134 | + - uses: actions/checkout@v3 |
| 135 | + - name: install QT |
| 136 | + uses: jurplel/install-qt-action@v4 |
| 137 | + with: |
| 138 | + version: 6.5.3 |
| 139 | + |
| 140 | + - name: build tsapp |
| 141 | + shell: cmd |
| 142 | + run: | |
| 143 | + set TONGSUO_HOME=%RUNNER_TEMP%\tongsuo |
| 144 | + set PREFIX=%RUNNER_TEMP%\tsapp |
| 145 | + qmake |
| 146 | + nmake /S |
| 147 | + nmake install |
| 148 | +
|
| 149 | + - name: package |
| 150 | + shell: cmd |
| 151 | + run: | |
| 152 | + set PKG_DIR=tsapp-WIN64 |
| 153 | + mkdir %PKG_DIR% |
| 154 | + cp %RUNNER_TEMP%\tsapp\tsapp.exe %PKG_DIR%\ |
| 155 | + windeployqt --qmldir . %PKG_DIR%\tsapp.exe |
| 156 | + "C:\Program Files\WinRAR\WinRAR.exe" a tsapp.zip %PKG_DIR%\ |
| 157 | + cd |
| 158 | + dir |
| 159 | +
|
| 160 | + - name: upload artifact |
| 161 | + uses: actions/upload-release-asset@v1 |
| 162 | + env: |
| 163 | + GITHUB_TOKEN: ${{ github.token }} |
| 164 | + with: |
| 165 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 166 | + asset_path: ${{ github.workspace }}\tsapp.zip |
| 167 | + asset_name: tsapp-${{ runner.os }}.zip |
| 168 | + asset_content_type: application/zip |
| 169 | + |
0 commit comments