3.9.0 #86
Workflow file for this run
This file contains hidden or 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: publish-release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'release tag' | |
| required: false | |
| type: string | |
| commitId: | |
| description: 'specific commit ID to build' | |
| required: false | |
| type: string | |
| release: | |
| types: [published] | |
| jobs: | |
| get-version: | |
| runs-on: lynx-ubuntu-22.04-medium | |
| timeout-minutes: 60 | |
| outputs: | |
| version: ${{ steps.get_version.outputs.VERSION }} | |
| steps: | |
| - name: Get Version | |
| id: get_version | |
| run: |- | |
| if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then | |
| version=${{ github.event.inputs.tag }} | |
| else | |
| version=$(echo ${{ github.ref }} | awk -F "/" '{print $3}') | |
| fi | |
| if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ || \ | |
| $version =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ || \ | |
| $version =~ ^[0-9]+\.[0-9]+\.[0-9]+-alpha\.[0-9]+$ ]]; then | |
| echo "Version is valid" | |
| echo "VERSION=$version" >> $GITHUB_OUTPUT; | |
| else | |
| echo "Version is invalid" | |
| exit 1 | |
| fi | |
| android-explorer-build: | |
| timeout-minutes: 60 | |
| runs-on: lynx-ubuntu-22.04-large | |
| needs: get-version | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Build Explorer App | |
| uses: ./lynx/.github/actions/android-explorer-build | |
| with: | |
| abi-list: armeabi-v7a,x86,x86_64,arm64-v8a | |
| - name: push to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.get-version.outputs.version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: '${{ github.workspace }}/lynx/explorer/android/lynx_explorer/build/outputs/apk/noasan/release/LynxExplorer-noasan-release.apk' | |
| allowUpdates: true | |
| body: '' | |
| ios-explorer-build: | |
| timeout-minutes: 60 | |
| runs-on: lynx-darwin-14-medium | |
| needs: get-version | |
| strategy: | |
| matrix: | |
| arch: [arm64, x86_64] | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Build Explorer App | |
| uses: ./lynx/.github/actions/ios-explorer-build | |
| with: | |
| build-arch: ${{ matrix.arch }} | |
| - name: push explorer to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.get-version.outputs.version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: '${{ github.workspace }}/lynx/LynxExplorer-${{ matrix.arch }}.app.tar.gz' | |
| allowUpdates: true | |
| body: '' | |
| harmony-explorer-build: | |
| runs-on: lynx-custom-container | |
| container: | |
| image: ghcr.io/lynx-family/ubuntu24.04-harmony@sha256:bf493c3710de3c44bfa84caf402c0727b9310c42497f6e52580ad441ea640ef1 | |
| credentials: | |
| username: lynx-family | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| needs: get-version | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }} | |
| shell: bash | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Build Explorer App | |
| uses: ./lynx/.github/actions/harmony-explorer-build | |
| - name: push explorer to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.get-version.outputs.version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: '${{ github.workspace }}/lynx/explorer/harmony/lynx_explorer/build/default/outputs/default/lynx_explorer-default-unsigned.hap' | |
| allowUpdates: true | |
| body: '' | |
| android-sdk-release: | |
| runs-on: ubuntu-22.04 | |
| needs: get-version | |
| timeout-minutes: 240 | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Free up disk space | |
| uses: ./lynx/.github/actions/free-android-disk | |
| - name: Python Setup | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Setup Android environment | |
| uses: ./lynx/.github/actions/setup-android-env | |
| - name: Install Common Dependencies | |
| uses: ./lynx/.github/actions/common-deps | |
| with: | |
| cache-backend: 'github' | |
| - name: Android SDK Release | |
| uses: ./lynx/.github/actions/android-sdk-release | |
| with: | |
| version: ${{ needs.get-version.outputs.version }} | |
| signingKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
| signingPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| signingSecretKey: ${{ secrets.SIGNING_SECRET_KEY }} | |
| abiList: 'armeabi-v7a,x86,x86_64,arm64-v8a' | |
| - name: Package maven artifacts | |
| run: |- | |
| cd $GITHUB_WORKSPACE/lynx | |
| pushd platform/android | |
| ./gradlew zipArtifacts -Pversion=${{ needs.get-version.outputs.version }} getArtifactList | |
| popd | |
| pushd platform/android/build | |
| artifact_list=$(<artifact-list) | |
| echo "::set-output name=artifact_list::$artifact_list" | |
| popd | |
| id: build_artifact | |
| - name: Publish artifact to maven | |
| uses: lynx-infra/maven-publish-action@53b4da2f23f9cfc4e905b135eda2724fcf5a0f0e | |
| with: | |
| portal_api_token: ${{ secrets.PORTAL_API_TOKEN }} | |
| artifact_path_list: ${{ steps.build_artifact.outputs.artifact_list }} | |
| ios-sdk-publish: | |
| timeout-minutes: 60 | |
| runs-on: macos-14 | |
| needs: get-version | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| path: lynx | |
| - name: Python Setup | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Set up Ruby + specify Bundler version | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '2.6.10' | |
| - name: Install Common Dependencies | |
| uses: ./lynx/.github/actions/common-deps | |
| with: | |
| cache-backend: github | |
| - name: Setup Ruby Cache | |
| uses: ./lynx/.github/actions/ios-common-deps | |
| with: | |
| cache-backend: 'github' | |
| - name: Publish iOS SDK | |
| uses: ./lynx/.github/actions/ios-sdk-publish | |
| with: | |
| version: ${{ needs.get-version.outputs.version }} | |
| tag: ${{ needs.get-version.outputs.version }} | |
| cocoapods_trunk_token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| component: all | |
| - name: Publish iOS dev SDK | |
| uses: ./lynx/.github/actions/ios-sdk-publish | |
| env: | |
| LYNX_ENABLE_RECORDER: 1 | |
| with: | |
| version: ${{ needs.get-version.outputs.version }}-dev | |
| tag: ${{ needs.get-version.outputs.version }} | |
| cocoapods_trunk_token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| component: all | |
| cocoapods-lynx-library-publish: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-22.04 | |
| needs: get-version | |
| environment: rubygems | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| path: lynx | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.1' | |
| - name: Resolve gem version | |
| id: gem_version | |
| env: | |
| RELEASE_VERSION: ${{ needs.get-version.outputs.version }} | |
| run: |- | |
| gem_version=$(ruby -e "puts Gem::Version.new(ENV.fetch('RELEASE_VERSION')).to_s") | |
| echo "Gem version: $gem_version" | |
| echo "version=$gem_version" >> "$GITHUB_OUTPUT" | |
| - name: Check published version | |
| id: published_version | |
| run: |- | |
| versions=$(gem list --remote --exact --all cocoapods-lynx-library || true) | |
| echo "Published versions: ${versions:-none}" | |
| if echo "$versions" | tr '(), ' '\n' | grep -Fx "${{ steps.gem_version.outputs.version }}" > /dev/null; then | |
| echo "publish_needed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "publish_needed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Test | |
| run: |- | |
| cd $GITHUB_WORKSPACE/lynx/tools/ios_tools/cocoapods-lynx-library | |
| ruby -Itest test/autolink_test.rb | |
| - name: Build | |
| id: build_gem | |
| env: | |
| GEM_VERSION: ${{ steps.gem_version.outputs.version }} | |
| run: |- | |
| cd $GITHUB_WORKSPACE/lynx/tools/ios_tools/cocoapods-lynx-library | |
| ruby <<'RUBY' | |
| path = 'cocoapods-lynx-library.gemspec' | |
| version = ENV.fetch('GEM_VERSION') | |
| content = File.read(path) | |
| updated = content.sub(/spec\.version\s*=\s*['"][^'"]+['"]/, "spec.version = '#{version}'") | |
| abort "Unable to update #{path} version" if updated == content | |
| File.write(path, updated) | |
| RUBY | |
| gem build cocoapods-lynx-library.gemspec | tee gem-build.log | |
| gem_file=$(awk -F': ' '/File:/ {print $2}' gem-build.log | tail -n 1) | |
| echo "gem_file=$gem_file" >> "$GITHUB_OUTPUT" | |
| ruby -rrubygems/package -e 'spec = Gem::Package.new(ARGV.fetch(0)).spec; puts "#{spec.name} #{spec.version}"; puts spec.summary' "$gem_file" | |
| - name: Upload gem artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cocoapods-lynx-library-${{ steps.gem_version.outputs.version }} | |
| path: lynx/tools/ios_tools/cocoapods-lynx-library/${{ steps.build_gem.outputs.gem_file }} | |
| - name: Publish CocoaPods plugin | |
| if: steps.published_version.outputs.publish_needed == 'true' | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| run: |- | |
| cd $GITHUB_WORKSPACE/lynx/tools/ios_tools/cocoapods-lynx-library | |
| if [ -z "$GEM_HOST_API_KEY" ]; then | |
| echo "RUBYGEMS_API_KEY is required to publish cocoapods-lynx-library." | |
| exit 1 | |
| fi | |
| gem push "${{ steps.build_gem.outputs.gem_file }}" | |
| harmony-sdk-publish: | |
| name: Publish Harmony SDK (${{ matrix.label }}) | |
| runs-on: lynx-custom-container | |
| container: | |
| image: ghcr.io/lynx-family/ubuntu24.04-harmony@sha256:25913874dad0557526b44f9c9ab30b9873080009db85bb569d718d2bb5f0e074 | |
| credentials: | |
| username: lynx-family | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| defaults: | |
| run: | |
| shell: bash | |
| needs: get-version | |
| strategy: | |
| matrix: | |
| include: | |
| - version_suffix: '' | |
| modules: 'default' | |
| build_param: '' | |
| label: 'formal' | |
| - version_suffix: '-dev' | |
| modules: 'lynx lynx_devtool lynx_base' | |
| build_param: '--dev' | |
| label: 'dev' | |
| steps: | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| - name: Install git-cliff | |
| run: | | |
| cargo install git-cliff --locked | |
| git-cliff --version | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| - name: Get latest tag | |
| id: get-latest-tag | |
| uses: ./lynx/.github/actions/get-latest-tag | |
| with: | |
| current-tag: ${{ needs.get-version.outputs.version }} | |
| - name: Install Common Dependencies | |
| uses: ./lynx/.github/actions/common-deps | |
| with: | |
| cache-key-prefix: '-container' | |
| - name: Generate Change Log | |
| run: | | |
| cd $GITHUB_WORKSPACE/lynx | |
| source tools/envsetup.sh | |
| COMMIT_ID=$(git rev-list -n 1 ${{ steps.get-latest-tag.outputs.latest-tag }}) | |
| python3 explorer/harmony/script/generate_changelog.py --version ${{ needs.get-version.outputs.version }}${{ matrix.version_suffix }} --modules ${{ matrix.modules }} --base_commit $COMMIT_ID | |
| - name: Build Harmony SDK | |
| run: | | |
| cd $GITHUB_WORKSPACE/lynx | |
| source tools/envsetup.sh | |
| pushd platform/harmony && ohpm install && popd | |
| pushd explorer/harmony && ohpm install && popd | |
| python3 explorer/harmony/script/build.py ${{ matrix.build_param }} --build_lynx_core --build_har --modules ${{ matrix.modules }} --override_version ${{ needs.get-version.outputs.version }}${{ matrix.version_suffix }} | |
| - name: Publish Harmony SDK | |
| run: | | |
| cd $GITHUB_WORKSPACE/lynx | |
| source tools/envsetup.sh | |
| export PUBLISH_KEY_PASSPHRASE=${{ secrets.HARMONY_PUBLISH_KEY_PASSPHRASE }} | |
| cat << EOF > publish_key | |
| ${{ secrets.HARMONY_PUBLISH_KEY }} | |
| EOF | |
| ohpm config set publish_registry https://ohpm.openharmony.cn/ohpm | |
| export PUBLISH_ID=${{ secrets.HARMONY_PUBLISH_ID }} | |
| export KEY_PATH=$GITHUB_WORKSPACE/lynx/publish_key | |
| python3 explorer/harmony/script/publish.py --modules ${{ matrix.modules }} --version ${{ needs.get-version.outputs.version }}${{ matrix.version_suffix }} | |
| macos-explorer-release: | |
| timeout-minutes: 60 | |
| runs-on: lynx-darwin-14-medium | |
| needs: get-version | |
| strategy: | |
| matrix: | |
| arch: [arm64, x64] | |
| steps: | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Build macOS Explorer | |
| uses: ./lynx/.github/actions/macos-explorer-build | |
| with: | |
| build-arch: ${{ matrix.arch }} | |
| - name: push explorer to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.get-version.outputs.version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: '${{ github.workspace }}/lynx/LynxExplorer-macos-${{ matrix.arch }}.app.tar.gz,${{ github.workspace }}/lynx/out/Default/lynx_sdk_macos_${{ matrix.arch }}.zip' | |
| allowUpdates: true | |
| body: '' | |
| windows-explorer-release: | |
| timeout-minutes: 60 | |
| runs-on: lynx-windows-2022-large | |
| needs: get-version | |
| strategy: | |
| matrix: | |
| arch: [x86, x64] | |
| steps: | |
| - name: Configure Git | |
| shell: PowerShell | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| git config --global http.sslBackend "schannel" | |
| working-directory: ./ | |
| - name: Download Source | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: lynx | |
| ref: ${{ github.event.inputs.commitId || github.ref }} | |
| fetch-depth: 0 | |
| - name: Python Setup | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Common Dependencies | |
| uses: ./lynx/.github/actions/windows-common-deps | |
| with: | |
| target: 'clay' | |
| - name: Build windows Explorer | |
| uses: ./lynx/.github/actions/windows-explorer-build | |
| with: | |
| build-arch: ${{ matrix.arch }} | |
| - name: push explorer to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ needs.get-version.outputs.version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: '${{ github.workspace }}/lynx/LynxExplorer-windows-${{ matrix.arch }}.tar.gz,${{ github.workspace }}/lynx/out/Default/lynx_sdk_windows_${{ matrix.arch }}.zip' | |
| allowUpdates: true | |
| body: '' |