From 14e5d41bf1238490ede287116f7d533fa08b1ae8 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 27 Mar 2024 18:55:54 +0100 Subject: [PATCH] fix: update CI actions (#1427) avoid actions that use node16 https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ also - only publish if running on main fork - not on user forks --- .github/workflows/ci.yml | 38 ++++++++++---------- .github/workflows/release-java-snapshot.yaml | 3 +- .github/workflows/release.yaml | 5 +-- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f1ffc36d8..a200dc4f94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,9 +48,9 @@ jobs: matrix: java-version: ["8", "11", "17", "21"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} distribution: 'temurin' @@ -67,7 +67,7 @@ jobs: name: GraalVM CI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: graalvm/setup-graalvm@v1 with: java-version: '21' @@ -81,9 +81,9 @@ jobs: name: Scala CI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 distribution: 'temurin' @@ -99,9 +99,9 @@ jobs: name: Integration Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 distribution: 'temurin' @@ -116,9 +116,9 @@ jobs: os: [ubuntu-latest, macos-latest, windows-2022] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Upgrade npm @@ -129,7 +129,7 @@ jobs: # OS (such as macos -latest) uses python3.12 by default, so python 3.8 # is used here to avoid this problem. - name: Set up Python3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Run CI with NodeJS @@ -143,9 +143,9 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.11 - uses: dtolnay/rust-toolchain@nightly @@ -159,9 +159,9 @@ jobs: os: [ubuntu-latest, macos-12, macos-14] # macos-12: x86, macos-14: arm64 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: Run C++ CI with Bazel @@ -175,9 +175,9 @@ jobs: matrix: python-version: [3.7, 3.12] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install bazel @@ -212,16 +212,16 @@ jobs: name: Code Style Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 21 distribution: 'oracle' - name: Check License Header uses: korandoru/hawkeye@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Check code style diff --git a/.github/workflows/release-java-snapshot.yaml b/.github/workflows/release-java-snapshot.yaml index 6f038c7c1c..15f79575ea 100644 --- a/.github/workflows/release-java-snapshot.yaml +++ b/.github/workflows/release-java-snapshot.yaml @@ -26,10 +26,11 @@ on: jobs: publish-java: runs-on: ubuntu-latest + if: github.repository == 'apache/incabator-fury' steps: - uses: actions/checkout@v4 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '8' distribution: 'adopt' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 945bef105a..b1d5fd8156 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,6 +26,7 @@ jobs: release-python: name: Publish Fury Python to PyPI runs-on: ubuntu-20.04 + if: github.repository == 'apache/incubator-fury' environment: name: pypi url: https://pypi.org/project/pyfury @@ -33,9 +34,9 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9, 3.10.12, 3.11, 3.12] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install bazel