/
githubmirror
/
netty
Обзор
Документация
Войти
/
githubmirror
/
netty
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.2
.github/workflows/ci-deploy.yml
307 строк
12 KB
Norman Maurer
Fix deploy snapshot
09 июл 2026, 19:19
09 июл 2026, 19:19
b682242
Код
Авторство
О чём код?
# ---------------------------------------------------------------------------- # Copyright 2021 The Netty Project # # The Netty Project licenses this file to you under the Apache License, # version 2.0 (the "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at: # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # ---------------------------------------------------------------------------- name: Deploy project on: push: branches: [ "4.2" ] schedule: - cron: '30 1 * * 1' # At 01:30 on Monday, every Monday. # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: read-all env: MAVEN_OPTS: -Xmx6g -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 # Cancel running jobs when a new push happens to the same branch as otherwise it will # tie up too many resources without providing much value. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: stage-snapshot-linux: runs-on: ubuntu-22.04 strategy: matrix: include: - setup: linux-x86_64-java11 docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml build" docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run stage-snapshot" - setup: linux-aarch64 docker-compose-build: "-f docker/docker-compose.centos-7.cross.yaml build" docker-compose-run: "-f docker/docker-compose.centos-7.cross.yaml run cross-compile-aarch64-stage-snapshot" - setup: linux-riscv64 docker-compose-build: "-f docker/docker-compose.ubuntu-20.04.cross.yaml build" docker-compose-run: "-f docker/docker-compose.ubuntu-20.04.cross.yaml run cross-compile-riscv64-stage-snapshot" name: stage-snapshot-${{ matrix.setup }} steps: # Pinned to v4.3.1 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Cache .m2/repository # Pinned to v4.3.0 - name: Cache local Maven repository uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 continue-on-error: true with: path: ~/.m2/repository key: cache-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | cache-maven-${{ hashFiles('**/pom.xml') }} cache-maven- - name: Create local staging directory run: mkdir -p ~/local-staging - name: Build docker image run: docker compose ${{ matrix.docker-compose-build }} - name: Stage snapshots to local staging directory run: docker compose ${{ matrix.docker-compose-run }} # Pinned to v4.6.2 - name: Upload local staging directory uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: ${{ matrix.setup }}-local-staging path: ~/local-staging if-no-files-found: error include-hidden-files: true stage-snapshot-macos: strategy: fail-fast: false matrix: include: - setup: macos-x86_64-java11 os: macos-15-intel - setup: macos-aarch64-java11 os: macos-15 runs-on: ${{ matrix.os }} name: ${{ matrix.setup }} build steps: # Pinned to v4.3.1 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Pinned to v4.8.0 - name: Set up JDK 11 uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 with: distribution: 'zulu' java-version: '11' # Cache .m2/repository # Pinned to v4.3.0 - name: Cache local Maven repository uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 continue-on-error: true with: path: ~/.m2/repository key: cache-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | cache-maven-${{ hashFiles('**/pom.xml') }} cache-maven- - name: Install tools via brew run: brew bundle - name: Create local staging directory run: mkdir -p ~/local-staging - name: Stage snapshots to local staging directory run: ./mvnw -B -ntp clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DskipRemoteStaging=true -DaltStagingDirectory=$HOME/local-staging -DskipTests=true # Pinned to v4.6.2 - name: Upload local staging directory uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: ${{ matrix.setup }}-local-staging path: ~/local-staging if-no-files-found: error include-hidden-files: true stage-snapshot-windows-x86_64: runs-on: windows-2022 name: stage-snapshot-windows-x86_64 env: # Let's limit the amount of ram that is used to unpack rustup as we saw # failures sometimes due the fact that not enough memory could be reserved. RUSTUP_UNPACK_RAM: 134217728 # Use 128 MiB steps: # Pinned to v4.3.1 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Pinned to v4.8.0 - name: Set up JDK 11 uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 with: distribution: 'zulu' java-version: 11 # Cache .m2/repository # Pinned to v4.3.0 - name: Cache local Maven repository uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 continue-on-error: true with: path: ~/.m2/repository key: cache-windows-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | cache-windows-maven-${{ hashFiles('**/pom.xml') }} cache-windows-maven- # Pinned to 1.96.1 - name: Install stable rust toolchain uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 with: targets: x86_64-pc-windows-msvc toolchain: 'stable' # Pinned to v2 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # Pinned to v1.13.0 - name: Configuring Developer Command Prompt uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 with: arch: x86_amd64 # Pinned to v3.4.0 - name: Install tools uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 with: args: install ninja nasm - name: Stage snapshots to local staging directory run: ./mvnw.cmd -B -ntp --file pom.xml clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DskipRemoteStaging=true -DaltStagingDirectory=/local-staging -DskipTests=true # Pinned to v4.6.2 - name: Upload local staging directory uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: windows-x86_64-local-staging path: /local-staging if-no-files-found: error include-hidden-files: true deploy-staged-snapshots: runs-on: ubuntu-22.04 # Wait until we have staged everything needs: [ stage-snapshot-linux, stage-snapshot-windows-x86_64, stage-snapshot-macos ] steps: # Pinned to v4.3.1 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # Pinned to v4.8.0 - name: Set up JDK 11 uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 with: distribution: 'zulu' java-version: '11' # Cache .m2/repository # Pinned to v4.3.0 - name: Cache local Maven repository uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 continue-on-error: true with: path: ~/.m2/repository key: cache-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | cache-maven-${{ hashFiles('**/pom.xml') }} cache-maven- # Pinned to v3.0.0 - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd with: servers: | [{ "id": "central-portal-snapshots", "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}", "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}" }] # Hardcode the staging artifacts that need to be downloaded. # These must match the matrix setups. There is currently no way to pull this out of the config. # Pinned to v4.3.0 - name: Download windows_x86_64 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: windows-x86_64-local-staging path: ~/windows-x86_64-local-staging # Pinned to v4.3.0 - name: Download macos-aarch64-java11 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: macos-aarch64-java11-local-staging path: ~/macos-aarch64-java11-local-staging # Pinned to v4.3.0 - name: Download macos-x86_64-java11 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: macos-x86_64-java11-local-staging path: ~/macos-x86_64-java11-local-staging # Pinned to v4.3.0 - name: Download linux-aarch64 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: linux-aarch64-local-staging path: ~/linux-aarch64-local-staging # Pinned to v4.3.0 - name: Download linux-riscv64 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: linux-riscv64-local-staging path: ~/linux-riscv64-local-staging # Pinned to v4.3.0 - name: Download linux-x86_64-java11 staging directory uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: linux-x86_64-java11-local-staging path: ~/linux-x86_64-java11-local-staging - name: Copy previous build artifacts to local maven repository run: bash ./.github/scripts/local_staging_install_snapshot.sh ~/.m2/repository ~/windows-x86_64-local-staging ~/macos-aarch64-java11-local-staging ~/macos-x86_64-java11-local-staging ~/linux-aarch64-local-staging ~/linux-riscv64-local-staging ~/linux-x86_64-java11-local-staging - name: Generate netty-codec-http3 and deploy to local staging. run: | mkdir -p ~/codec-http3-local-staging ./mvnw -B --file pom.xml -Pnative-dependencies -pl all clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DskipRemoteStaging=true -DaltStagingDirectory=$HOME/codec-http3-local-staging -DskipTests=true - name: Generate netty-all and deploy to local staging. run: | mkdir -p ~/all-local-staging ./mvnw -B --file pom.xml -Pnative-dependencies -pl all clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DskipRemoteStaging=true -DaltStagingDirectory=$HOME/all-local-staging -DskipTests=true - name: Merge staging repositories run: bash ./.github/scripts/local_staging_merge_snapshot.sh ~/local-staging ~/windows-x86_64-local-staging ~/macos-aarch64-java11-local-staging ~/macos-x86_64-java11-local-staging ~/linux-aarch64-local-staging ~/linux-riscv64-local-staging ~/linux-x86_64-java11-local-staging ~/codec-http3-local-staging ~/all-local-staging - name: Deploy local staged artifacts run: ./mvnw -B -ntp --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$HOME/local-staging -DserverId=central-portal-snapshots