Skip to content

Commit

Permalink
Re-sync with internal repository
Browse files Browse the repository at this point in the history
  • Loading branch information
facebook-github-bot authored and bolinfest committed Nov 15, 2022
1 parent c410b86 commit 5076656
Show file tree
Hide file tree
Showing 656 changed files with 154,200 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/sapling-addons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Verify addons/ folder
on:
# Run on any branch to support ghstack's synthetic base/head branches.
pull_request:
workflow_dispatch:
push:
branches:
- main

jobs:
verify-addons:
runs-on: ubuntu-latest
# Our build container already has Node, Yarn, and Python installed.
container:
image: ${{ format('ghcr.io/{0}/build_ubuntu_20_04:latest', github.repository) }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: yarn install
working-directory: ./addons
run: yarn install --prefer-offline
- name: Run addons/verify-addons-folder.py
working-directory: ./addons
run: ./verify-addons-folder.py
63 changes: 63 additions & 0 deletions .github/workflows/sapling-cli-homebrew-macos-arm64-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release - Homebrew macOS-arm64
'on':
workflow_dispatch: null
push:
tags:
- v*
- test-release-*
jobs:
build:
runs-on: macos-12
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: Prepare build environment
run: 'eden/scm/packaging/mac/prepare_environment.py \
-s c11b17c8b78efa46dac2d213cd7a7b3fff75f6f5e6d2ef2248345cd4a900b1c6 -f openssl@1.1 \
-s 3e95fbf0f18b59af7aeaa957be4499a9c521ec199f2ec2a419b8a7b9ac627a3a -f python@3.8 \
-t aarch64-apple-darwin \
-r ${{ env.SAPLING_VERSION }} \
-o $(brew tap-info homebrew/core | sed -n ''2p'' | awk ''{printf $1}'')/Formula/sapling.rb'
- name: Install and build Sapling bottle
run: brew install --build-bottle sapling
- name: Create Sapling bottle
run: brew bottle sapling
- name: Rename bottle to some platform specific name
run: mv sapling*monterey.bottle.tar.gz sapling_0.0-${{ env.SAPLING_VERSION }}.arm64_monterey.bottle.tar.gz
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: macos-homebrew-arm64-bottle
path: sapling*monterey.bottle.tar.gz
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: macos-homebrew-arm64-bottle
- name: Create pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)
- name: Upload Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) sapling*monterey.bottle.tar.gz
63 changes: 63 additions & 0 deletions .github/workflows/sapling-cli-homebrew-macos-x86-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release - Homebrew macOS-x86
'on':
workflow_dispatch: null
push:
tags:
- v*
- test-release-*
jobs:
build:
runs-on: macos-12
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: Prepare build environment
run: 'eden/scm/packaging/mac/prepare_environment.py \
-s d915175bedb146e38d7a2c95e86888a60a5058a5cd21f835813d43d1372a29d9 -f openssl@1.1 \
-s c247a261048c510b963705acfbea23b09cc193b5d4256a5d10b42d199a8f8869 -f python@3.8 \
-t x86_64-apple-darwin \
-r ${{ env.SAPLING_VERSION }} \
-o $(brew tap-info homebrew/core | sed -n ''2p'' | awk ''{printf $1}'')/Formula/sapling.rb'
- name: Install and build Sapling bottle
run: brew install --build-bottle sapling
- name: Create Sapling bottle
run: brew bottle sapling
- name: Rename bottle to some platform specific name
run: mv sapling*monterey.bottle.tar.gz sapling_0.0-${{ env.SAPLING_VERSION }}.monterey.bottle.tar.gz
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: macos-homebrew-x86-bottle
path: sapling*monterey.bottle.tar.gz
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: macos-homebrew-x86-bottle
- name: Create pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)
- name: Upload Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) sapling*monterey.bottle.tar.gz
26 changes: 26 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-20.04-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI - Ubuntu 20.04
'on': workflow_dispatch
jobs:
build-deb:
runs-on: ubuntu-latest
container:
image: ${{ format('ghcr.io/{0}/build_ubuntu_20_04:latest', github.repository) }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: rustup
run: rustup default stable
- name: set-env DEB_UPSTREAM_VERSION
shell: bash
run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: Create .deb
working-directory: ./eden/scm
run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }}
- name: Rename .deb
working-directory: ./eden/scm
run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }}
26 changes: 26 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-20.04-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image - ubuntu:20.04
'on':
workflow_dispatch: null
schedule:
- cron: 0 1 * * mon
jobs:
clone-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
file: .github/workflows/sapling-cli-ubuntu-20.04.Dockerfile
push: true
tags: ${{ format('ghcr.io/{0}/build_ubuntu_20_04:latest', github.repository) }}
58 changes: 58 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-20.04-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release - Ubuntu 20.04
'on':
workflow_dispatch: null
push:
tags:
- v*
- test-release-*
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ format('ghcr.io/{0}/build_ubuntu_20_04:latest', github.repository) }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: rustup
run: rustup default stable
- name: set-env DEB_UPSTREAM_VERSION
shell: bash
run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: Create .deb
working-directory: ./eden/scm
run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }}
- name: Rename .deb
working-directory: ./eden/scm
run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ubuntu-20.04
path: ./eden/scm/sapling_*.deb
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ubuntu-20.04
- name: Create pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)
- name: Upload Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) sapling_*.deb
56 changes: 56 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-20.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:20.04

# https://serverfault.com/a/1016972 to ensure installing tzdata does not
# result in a prompt that hangs forever.
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

# Update and install some basic packages to register a PPA.
RUN apt-get -y update
RUN apt-get -y install curl git

# Use a PPA to ensure a specific version of Node (the default Node on
# Ubuntu 20.04 is v10, which is too old):
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -

# Now we can install the bulk of the packages:
RUN apt-get -y install nodejs pkg-config libssl-dev cython3 make g++ dpkg-dev python3.8 python3.8-dev python3.8-distutils

# Unfortunately, we cannot `apt install cargo` because at the time of this
# writing, it installs a version of cargo that is too old (1.59). Specifically,
# cargo <1.60 has a known issue with weak dependency features:
#
# https://github.com/rust-lang/cargo/issues/10623
#
# which is new Cargo syntax that was introduced in Rust 1.60:
#
# https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
#
# and indeed one of our dependencies makes use of this feature:
# https://github.com/rust-phf/rust-phf/blob/250c6b456fe28c0c8213518d6bddfd972922fd53/phf/Cargo.toml#L22
#
# Realistically, the Rust ecosystem moves forward quickly, so installing via
# rustup is the most sustainable option.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
ENV PATH="/root/.cargo/bin:${PATH}"

# Copy the full repo over because `cargo fetch` follows deps within the repo,
# so assume it needs everything.
COPY . /tmp/repo
WORKDIR /tmp/repo

# Create and populate a Yarn offline mirror by running `yarn install`
# in the addons/ folder that contains yarn.lock, package.json, and the
# package.json file for each entry in the Yarn workspace.
RUN npm install --global yarn
RUN yarn config set yarn-offline-mirror "$HOME/npm-packages-offline-cache"
# If the addons/ folder is moved or no longer contains a package.json,
# this command will fail and should be updated to reflect the new location.
RUN yarn --cwd addons install --prefer-offline

# Verify the yarn-offline-mirror was populated.
RUN find $(yarn config get yarn-offline-mirror)

# Clean up to reduce the size of the Docker image.
WORKDIR /root
RUN rm -rf /tmp/repo
26 changes: 26 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-22.04-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI - Ubuntu 22.04
'on': workflow_dispatch
jobs:
build-deb:
runs-on: ubuntu-latest
container:
image: ${{ format('ghcr.io/{0}/build_ubuntu_22_04:latest', github.repository) }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: rustup
run: rustup default stable
- name: set-env DEB_UPSTREAM_VERSION
shell: bash
run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV
- name: Create .deb
working-directory: ./eden/scm
run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }}
- name: Rename .deb
working-directory: ./eden/scm
run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }}
26 changes: 26 additions & 0 deletions .github/workflows/sapling-cli-ubuntu-22.04-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image - ubuntu:22.04
'on':
workflow_dispatch: null
schedule:
- cron: 0 1 * * mon
jobs:
clone-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
file: .github/workflows/sapling-cli-ubuntu-22.04.Dockerfile
push: true
tags: ${{ format('ghcr.io/{0}/build_ubuntu_22_04:latest', github.repository) }}
Loading

0 comments on commit 5076656

Please sign in to comment.