From 5d5a7f129101dbb1e8734c8aa37e29f4fb5c6c78 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 12 Oct 2024 15:55:06 +0200 Subject: [PATCH 1/2] Regen release.yml, update some actions, Drop Fedora 36 and 37, Add Ubuntu 24 and Fedora 39 and 40 --- .github/workflows/generate-release-yml.rs | 4 +- .github/workflows/release.yml | 155 ++++++++++++++-------- .github/workflows/release.yml.in | 26 ++-- 3 files changed, 118 insertions(+), 67 deletions(-) diff --git a/.github/workflows/generate-release-yml.rs b/.github/workflows/generate-release-yml.rs index 7a5b0c7f6ef5..f8ee80daf36f 100755 --- a/.github/workflows/generate-release-yml.rs +++ b/.github/workflows/generate-release-yml.rs @@ -33,12 +33,12 @@ fn parse_pattern(pattern: &String) -> Option<(Pattern, Vec<&'static str>)> { if pattern.contains("%UBUNTU_LTS_VERSION%") { Some(( Box::new(move |p: &str, s: &str| p.replace("%UBUNTU_LTS_VERSION%", s)), - vec!["20", "22"], + vec!["20", "22", "24"], )) } else if pattern.contains("%FEDORA_STABLE_VERSION%") { Some(( Box::new(move |p: &str, s: &str| p.replace("%FEDORA_STABLE_VERSION%", s)), - vec!["36", "37", "38"], + vec!["38", "39", "40"], )) } else { None diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e7548d4fda3..fe86b245c00c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,10 +5,9 @@ name: release push: tags: - v* - permissions: - contents: write # to create a release - + contents: write + packages: write jobs: prepare: runs-on: ubuntu-latest @@ -33,17 +32,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: "${{ github.repository_owner }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: "." build-args: UBUNTU_VERSION=20.04 @@ -54,86 +53,107 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: "${{ github.repository_owner }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: "." build-args: UBUNTU_VERSION=22.04 file: watchman/build/package/ubuntu-env/Dockerfile push: true tags: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-22:latest', github.repository) }}" - docker-fedora-36: + docker-ubuntu-24: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: "${{ github.repository_owner }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: "." - build-args: FEDORA_VERSION=36 + build-args: UBUNTU_VERSION=24.04 + file: watchman/build/package/ubuntu-env/Dockerfile + push: true + tags: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-24:latest', github.repository) }}" + docker-fedora-38: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: "${{ github.repository_owner }}" + password: "${{ secrets.GITHUB_TOKEN }}" + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: "." + build-args: FEDORA_VERSION=38 file: watchman/build/package/fedora-env/Dockerfile push: true - tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-36:latest', github.repository) }}" - docker-fedora-37: + tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}" + docker-fedora-39: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: "${{ github.repository_owner }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: "." - build-args: FEDORA_VERSION=37 + build-args: FEDORA_VERSION=39 file: watchman/build/package/fedora-env/Dockerfile push: true - tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-37:latest', github.repository) }}" - docker-fedora-38: + tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-39:latest', github.repository) }}" + docker-fedora-40: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: "${{ github.repository_owner }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: "." - build-args: FEDORA_VERSION=38 + build-args: FEDORA_VERSION=40 file: watchman/build/package/fedora-env/Dockerfile push: true - tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}" + tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-40:latest', github.repository) }}" clone-build-package-ubuntu-20: needs: - prepare @@ -145,7 +165,7 @@ jobs: - name: Fix HOME run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: "./install-system-packages.sh" - name: Fix dubious ownership @@ -176,7 +196,7 @@ jobs: - name: Fix HOME run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: "./install-system-packages.sh" - name: Fix dubious ownership @@ -196,18 +216,49 @@ jobs: asset_path: /_debs/watchman.deb asset_name: "watchman_ubuntu22.04_${{ needs.prepare.outputs.release }}.deb" asset_content_type: application/x-deb - clone-build-package-fedora-36: + clone-build-package-ubuntu-24: needs: - prepare - - docker-fedora-36 + - docker-ubuntu-24 runs-on: ubuntu-latest container: - image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-36:latest', github.repository) }}" + image: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-24:latest', github.repository) }}" steps: - name: Fix HOME run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: Install system dependencies + run: "./install-system-packages.sh" + - name: Fix dubious ownership + run: git config --global --add safe.directory /__w/watchman/watchman + - name: Build Watchman binaries + run: "./autogen.sh" + - name: Make .deb + env: + UBUNTU_VERSION: "24.04" + run: "./watchman/build/package/make-deb.sh" + - name: Upload .deb + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + uses: actions/upload-release-asset@v1 + with: + upload_url: "${{ needs.prepare.outputs.upload_url }}" + asset_path: /_debs/watchman.deb + asset_name: "watchman_ubuntu24.04_${{ needs.prepare.outputs.release }}.deb" + asset_content_type: application/x-deb + clone-build-package-fedora-38: + needs: + - prepare + - docker-fedora-38 + runs-on: ubuntu-latest + container: + image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}" + steps: + - name: Fix HOME + run: echo HOME=/root >> $GITHUB_ENV + - name: Checkout code + uses: actions/checkout@v4 - name: Install system dependencies run: "./install-system-packages.sh" - name: Fix dubious ownership @@ -217,7 +268,7 @@ jobs: - name: Make .rpm id: make_rpm env: - FEDORA_VERSION: "36" + FEDORA_VERSION: "38" run: "./watchman/build/package/make-rpm.sh" - name: Upload .rpm env: @@ -228,18 +279,18 @@ jobs: asset_path: "${{ steps.make_rpm.outputs.rpm_path }}" asset_name: "${{ steps.make_rpm.outputs.rpm_name }}" asset_content_type: application/x-rpm - clone-build-package-fedora-37: + clone-build-package-fedora-39: needs: - prepare - - docker-fedora-37 + - docker-fedora-39 runs-on: ubuntu-latest container: - image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-37:latest', github.repository) }}" + image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-39:latest', github.repository) }}" steps: - name: Fix HOME run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: "./install-system-packages.sh" - name: Fix dubious ownership @@ -249,7 +300,7 @@ jobs: - name: Make .rpm id: make_rpm env: - FEDORA_VERSION: "37" + FEDORA_VERSION: "39" run: "./watchman/build/package/make-rpm.sh" - name: Upload .rpm env: @@ -260,18 +311,18 @@ jobs: asset_path: "${{ steps.make_rpm.outputs.rpm_path }}" asset_name: "${{ steps.make_rpm.outputs.rpm_name }}" asset_content_type: application/x-rpm - clone-build-package-fedora-38: + clone-build-package-fedora-40: needs: - prepare - - docker-fedora-38 + - docker-fedora-40 runs-on: ubuntu-latest container: - image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}" + image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-40:latest', github.repository) }}" steps: - name: Fix HOME run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: "./install-system-packages.sh" - name: Fix dubious ownership @@ -281,7 +332,7 @@ jobs: - name: Make .rpm id: make_rpm env: - FEDORA_VERSION: "38" + FEDORA_VERSION: "40" run: "./watchman/build/package/make-rpm.sh" - name: Upload .rpm env: @@ -297,7 +348,7 @@ jobs: needs: prepare runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build watchman run: "python3 build/fbcode_builder/getdeps.py build --src-dir=. watchman --project-install-prefix watchman:/usr/local" - name: Copy artifacts @@ -320,7 +371,7 @@ jobs: needs: prepare runs-on: macOS-10.15 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build watchman run: "SDKROOT=$(xcrun --show-sdk-path --sdk macosx11.1) python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. watchman --project-install-prefix watchman:/usr/local" - name: Copy artifacts @@ -343,7 +394,7 @@ jobs: needs: prepare runs-on: windows-2019 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Export boost environment run: echo BOOST_ROOT=%BOOST_ROOT_1_69_0% >> %GITHUB_ENV% shell: cmd diff --git a/.github/workflows/release.yml.in b/.github/workflows/release.yml.in index 91c83436a3a6..323a5f875fb4 100644 --- a/.github/workflows/release.yml.in +++ b/.github/workflows/release.yml.in @@ -34,20 +34,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . build-args: "UBUNTU_VERSION=%UBUNTU_LTS_VERSION%.04" @@ -59,20 +59,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . build-args: "FEDORA_VERSION=%FEDORA_STABLE_VERSION%" @@ -94,7 +94,7 @@ jobs: run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: ./install-system-packages.sh @@ -134,7 +134,7 @@ jobs: run: echo HOME=/root >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install system dependencies run: ./install-system-packages.sh @@ -166,7 +166,7 @@ jobs: needs: prepare runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build watchman run: python3 build/fbcode_builder/getdeps.py build --src-dir=. watchman --project-install-prefix watchman:/usr/local - name: Copy artifacts @@ -192,7 +192,7 @@ jobs: # Xcode 12.4 on the macOS-10.15 image. runs-on: macOS-10.15 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build watchman run: SDKROOT=$(xcrun --show-sdk-path --sdk macosx11.1) python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. watchman --project-install-prefix watchman:/usr/local - name: Copy artifacts @@ -216,7 +216,7 @@ jobs: needs: prepare runs-on: windows-2019 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Export boost environment run: "echo BOOST_ROOT=%BOOST_ROOT_1_69_0% >> %GITHUB_ENV%" shell: cmd From d42042428ab7e88abd0c46317648bc3e02a4b2e2 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 12 Oct 2024 16:07:04 +0200 Subject: [PATCH 2/2] Switch macOs workflow to 11 as 10.15 is deprecated --- .github/workflows/release.yml | 2 +- .github/workflows/release.yml.in | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe86b245c00c..69103f4228fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -369,7 +369,7 @@ jobs: mac-build: continue-on-error: true needs: prepare - runs-on: macOS-10.15 + runs-on: macOS-11 steps: - uses: actions/checkout@v4 - name: Build watchman diff --git a/.github/workflows/release.yml.in b/.github/workflows/release.yml.in index 323a5f875fb4..e6310b6d39bd 100644 --- a/.github/workflows/release.yml.in +++ b/.github/workflows/release.yml.in @@ -188,9 +188,8 @@ jobs: mac-build: continue-on-error: true needs: prepare - # This release targets macOS 11.1 (Big Sur), which is available in - # Xcode 12.4 on the macOS-10.15 image. - runs-on: macOS-10.15 + # This release targets macOS 11.1 (Big Sur) + runs-on: macOS-11 steps: - uses: actions/checkout@v4 - name: Build watchman