Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
FROM archlinux:base-devel
|
||||
|
||||
ARG USERNAME=build
|
||||
# We use 1001 as the user UID here because 1000 is the UID for `runneradmin`,
|
||||
# but the actual jobs are run as `runner` (with UID 1001).
|
||||
ARG USER_UID=1001
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Set the packager name in makepkg.conf (so it doesn't say "Unknown Packager")
|
||||
# when someone queries package info for our packages.
|
||||
RUN echo 'PACKAGER="Warp Linux Maintainers <linux-maintainers@warp.dev>"' >> /etc/makepkg.conf
|
||||
|
||||
# Fetch package lists and install sudo, git, and protobuf (git is needed by
|
||||
# cargo to resolve git dependencies during license generation, and protobuf
|
||||
# provides protoc for generating rust bindings of protobuf APIs).
|
||||
RUN pacman -Sy --needed --noconfirm sudo git protobuf
|
||||
|
||||
# Downgrade fakeroot to version 1.34. Version 1.35 switches from calling
|
||||
# `close` in a loop to using the new `close_range` syscall, which seems to
|
||||
# be unavailable in the Ubuntu 20.04 environment that hosts this Docker
|
||||
# container.
|
||||
#
|
||||
# Syscall discussion: https://archlinuxarm.org/forum/viewtopic.php?f=15&t=16943
|
||||
# Downgrade discussion: https://github.com/docker/for-mac/issues/7331
|
||||
RUN pacman -U --noconfirm https://archive.archlinux.org/packages/f/fakeroot/fakeroot-1.34-1-x86_64.pkg.tar.zst
|
||||
|
||||
# Install cargo-about, which we require for bundling third-party licenses.
|
||||
RUN pacman -S --needed --noconfirm cargo-about
|
||||
|
||||
# Create our build user and give them sudo privileges.
|
||||
RUN groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
# Run as our build user instead of root, as makepkg must be run as a non-root
|
||||
# user.
|
||||
USER $USERNAME
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,41 @@
|
||||
# Important note: This must be run after we build the release binary; this only
|
||||
# packages up an already-built binary.
|
||||
|
||||
name: Bundle Arch Linux package
|
||||
description: Bundles an Arch Linux package for the given release channel.
|
||||
inputs:
|
||||
channel:
|
||||
description: The channel for which we want to build an Arch package.
|
||||
requred: true
|
||||
release-tag:
|
||||
description: The git release tag.
|
||||
required: true
|
||||
arch:
|
||||
description: The architecture we are building for
|
||||
required: true
|
||||
artifact:
|
||||
description: The artifact type to build (app or cli)
|
||||
required: false
|
||||
default: app
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Build Docker image
|
||||
shell: bash
|
||||
run: docker build -t arch-bundle-builder ${{ github.action_path }}
|
||||
|
||||
- name: Run in container
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/github/workspace" \
|
||||
-v "${{ github.workspace }}/target:/github/workspace/target" \
|
||||
-w /github/workspace \
|
||||
-v "${CARGO_HOME:-$HOME/.cargo}/git:/home/build/.cargo/git" \
|
||||
-v "${CARGO_HOME:-$HOME/.cargo}/registry:/home/build/.cargo/registry" \
|
||||
-e GIT_RELEASE_TAG="$GIT_RELEASE_TAG" \
|
||||
-e GITHUB_ACTIONS="$GITHUB_ACTIONS" \
|
||||
-e GITHUB_OUTPUT="/dev/null" \
|
||||
arch-bundle-builder \
|
||||
${{ inputs.channel }} ${{ inputs.release-tag }} ${{ inputs.arch }} ${{ inputs.artifact }}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BUILD_ARCH="$3"
|
||||
BUILD_ARCH="${BUILD_ARCH:-$(uname -m)}"
|
||||
|
||||
# Ensure we build with the most up-to-date package list. This could get stale due to Docker
|
||||
# filesystem caching.
|
||||
sudo pacman -Sy
|
||||
|
||||
# Run the bundle script, specifying the release channel and tag, skipping
|
||||
# building the binary (as we have already done so), and only bundling the
|
||||
# Arch package.
|
||||
./script/bundle --channel $1 --release-tag $2 --skip-build --packages arch --arch $BUILD_ARCH --artifact $4
|
||||
Reference in New Issue
Block a user