文件传输模块
增加离线提醒
#360
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build on macOS-arm | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'changelog.txt' | |
- 'LEGAL' | |
- 'LICENSE' | |
- '.clang-*' | |
- '.gitignore' | |
- '.github/**' | |
- '!.github/workflows/mac-arm.yml' | |
- 'lib/xdg/**' | |
- 'snap/**' | |
- 'docs/**' | |
- 'flatpak/**' | |
- 'vcpkg.json' | |
- 'vcpkg-*.json' | |
- 'src/base/platform/win/**' | |
- 'src/base/platform/linux/**' | |
branches: [ develop, develop-macos ] | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: [ develop, develop-macos ] | |
jobs: | |
macos: | |
name: MacOS-ARM | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
build_type: [ Release ] | |
env: | |
UPLOAD_ARTIFACT: "false" | |
ONLY_CACHE: "false" | |
PREPARE_PATH: "build-script/prepare-mac.sh" | |
steps: | |
- name: Get repository name. | |
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
- name: Clone. | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
path: ${{ env.REPO_NAME }} | |
- name: First set up. | |
run: | | |
sudo chown -R `whoami`:admin /usr/local/share | |
brew install automake | |
# Disable spotlight. | |
sudo mdutil -a -i off | |
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | |
- name: Prepare | |
run: | | |
chmod a+x ./$REPO_NAME/$PREPARE_PATH | |
./$REPO_NAME/$PREPARE_PATH | |
- name: Build ok-gloox | |
run: | | |
git clone https://github.com/okstar-org/ok-gloox.git | |
cd ok-gloox | |
cmake -B out -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
cmake --build out --config ${{ matrix.build_type }} | |
sudo cmake --install out --config ${{ matrix.build_type }} | |
- name: Build ok-rtc | |
run: | | |
git clone -b master https://github.com/okstar-org/ok-rtc.git | |
cd ok-rtc | |
git submodule update --init | |
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig:/opt/homebrew/opt/mozjpeg/lib/pkgconfig:/opt/homebrew/opt/ffmpeg@5/lib/pkgconfig" | |
cmake -B out -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DJPEG_LIBRARY=/opt/homebrew/opt/mozjpeg/lib -DJPEF_INCLUDE_DIR=/opt/homebrew/opt/mozjpeg/include | |
cmake --build out --config=${{ matrix.build_type }} | |
sudo cmake --install out --config ${{ matrix.build_type }} | |
- name: Install Qt | |
run: | | |
brew install qt@5 | |
echo "QT_PATH=$(brew --prefix qt@5)" >> $GITHUB_ENV | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ env.REPO_NAME }}/${{ github.workspace }}/out" >> "$GITHUB_OUTPUT" | |
- name: CMake Configure | |
run: | | |
export PKG_CONFIG_PATH="/opt/homebrew/opt/openal-soft/lib/pkgconfig:/opt/homebrew/opt/mozjpeg/lib/pkgconfig:/opt/homebrew/opt/ffmpeg@5/lib/pkgconfig" | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} -S ${{ github.workspace }}/${{ env.REPO_NAME }} -DCMAKE_PREFIX_PATH=${{ env.QT_PATH }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
- name: CMake Build | |
run: | | |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Decode and import certificate | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
echo "$MACOS_CERTIFICATE" | base64 --decode -o cert.p12 | |
security create-keychain -p "" build.keychain | |
security import cert.p12 -k build.keychain -P $CERTIFICATE_PASSWORD -T /usr/bin/codesign | |
security list-keychains -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
security set-keychain-settings build.keychain | |
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain | |
security find-identity -v -p codesigning | |
env: | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
- name: install create-dmg | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
brew install node | |
node -v | |
npm -v | |
sudo npm install --global create-dmg | |
create-dmg --version | |
security find-identity -v -p codesigning | |
- name: macdeployqt | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
${{env.QT_PATH }}/bin/macdeployqt ${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop.app | |
- name: create dmg | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
create-dmg --help | |
create-dmg --identity="Apple Development: [email protected] (DBN79CF4VB)" ${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop.app ${{ steps.strings.outputs.build-output-dir }}/bin/ | |
env: | |
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop macOS-arm64.dmg |