From d904913b04a82c486c987863963be9d4076c0208 Mon Sep 17 00:00:00 2001 From: orestonce Date: Mon, 8 Aug 2022 10:02:53 +0800 Subject: [PATCH] dmg --- .github/workflows/release-macos.yml | 63 +++++++++++++++++++ ...ublish-release.yml => release-windows.yml} | 4 +- 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-macos.yml rename .github/workflows/{publish-release.yml => release-windows.yml} (97%) diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml new file mode 100644 index 0000000..8b2e471 --- /dev/null +++ b/.github/workflows/release-macos.yml @@ -0,0 +1,63 @@ +# This is a basic workflow to help you get started with Actions + +name: CI-macos + +# Controls when the workflow will run +on: + release: + types: [ created ] +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: macos-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout + uses: actions/checkout@v2.4.2 + - name: Cache Primes + id: cache-primes + uses: actions/cache@v3 + with: + path: env/ + key: ${{ runner.os }}-primes3 + + # Runs a set of commands using the runners shell + - name: set up qt-static env + if: steps.cache-primes.outputs.cache-hit != 'true' + run: | + # https://build-qt.fsu0413.me/5.15-series/5.15.4-for-macos/ + mkdir -p env/download/ && cd env/download + curl -L https://osdn.net/downloads/users/38/38696/Qt5.15.4-macOS-x86_64-AppleClang12.0.5-20220513.tar.xz -o Qt5.15.4-macOS-x86_64-AppleClang12.0.5-20220513.tar.xz + tar xf Qt5.15.4-macOS-x86_64-AppleClang12.0.5-20220513.tar.xz + pwd + ls -al Qt5.15.4-macOS-x86_64-AppleClang12.0.5 + chmod +x Qt5.15.4-macOS-x86_64-AppleClang12.0.5/bin/* + mv Qt5.15.4-macOS-x86_64-AppleClang12.0.5 ../ + cd ../../ && rm -rf env/download + - name: Setup Go environment + uses: actions/setup-go@v3.2.1 + with: + # The Go version to download (if necessary) and use. Supports semver spec and ranges. + go-version: 1.18 # optional + - name: build + run: | + export PATH=$(pwd)"/env/Qt5.15.4-macOS-x86_64-AppleClang12.0.5/bin:"${PATH} + echo $PATH + go mod tidy && go run export/main.go "check-only" + cd m3u8d-qt && qmake && ls -alh && make + ls -alh m3u8d-qt.app && ls m3u8d-qt.app/Contents/ && ls -alh m3u8d-qt.app/Contents/MacOS + otool -L m3u8d-qt.app/Contents/MacOS/m3u8d-qt + install_name_tool -change m3u8d-impl @executable_path/m3u8d-impl m3u8d-qt.app/Contents/MacOS/m3u8d-qt + otool -L m3u8d-qt.app/Contents/MacOS/m3u8d-qt + cp m3u8d-impl m3u8d-qt.app/Contents/MacOS/ + macdeployqt m3u8d-qt.app -dmg && ls -alh + + - name: upload release + uses: Guerra24/upload-to-release@v1 + with: + name: m3u8d_qt_darwin_amd64-${{ github.ref_name }}.dmg + path: m3u8d-qt/m3u8d-qt.dmg + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/release-windows.yml similarity index 97% rename from .github/workflows/publish-release.yml rename to .github/workflows/release-windows.yml index 76a35af..1021d36 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/release-windows.yml @@ -55,7 +55,7 @@ jobs: uses: Guerra24/upload-to-release@v1 with: name: m3u8d_qt_windows_386-${{ github.ref_name }}.exe - path: m3u8d-qt\release\m3u8d-qt.exe + path: m3u8d-qt/release/m3u8d-qt.exe repo-token: ${{ secrets.GITHUB_TOKEN }} - name: upload release windows_386_cli uses: Guerra24/upload-to-release@v1 @@ -86,4 +86,4 @@ jobs: with: name: m3u8d_cli_darwin_amd64-${{ github.ref_name }} path: bin/m3u8d_cli_darwin_amd64 - repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + repo-token: ${{ secrets.GITHUB_TOKEN }}