Positron: Build Linux Releases #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Positron: Build Linux Releases" | |
# Callable workflow that builds Positron for Linux | |
# Note: our releases are now multi-platform, coordinated by build-release.yml | |
on: | |
workflow_call: | |
inputs: | |
build_number: | |
required: false | |
description: "The build distance number only, e.g. 123" | |
default: "999" | |
type: string | |
short_version: | |
required: true | |
description: "The short version number, including the build distance, e.g. 2023.12.0-123" | |
default: "2099.12.0-999" | |
type: string | |
workflow_dispatch: | |
# Ideally we'd have the `vscode-linux-prepare-` and | |
# `vscode-linux-build-` steps in different jobs, but the | |
# upload-artifact action to send the Positron build to these jobs fails | |
# because of https://github.com/actions/upload-artifact/issues/485 | |
jobs: | |
build-binaries: | |
name: Build Linux binaries | |
runs-on: ubuntu-latest-8x | |
timeout-minutes: 120 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
POSITRON_BUILD_NUMBER: ${{ inputs.build_number }} | |
strategy: | |
max-parallel: 1 | |
matrix: | |
arch: [x64] | |
steps: | |
# Checkout sources | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Build Environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y vim curl build-essential clang make cmake git python3-pip python-is-python3 libsodium-dev libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 libnss3 libnspr4 libasound2 libkrb5-dev | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Execute yarn | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
POSITRON_GITHUB_PAT: ${{ secrets.POSITRON_GITHUB_PAT }} | |
npm_config_arch: ${{ matrix.arch }} | |
run: | | |
# Install Yarn | |
npm install -g yarn | |
# Install node-gyp; this is required by some packages, and yarn | |
# sometimes fails to automatically install it. | |
yarn global add node-gyp | |
# Perform the main yarn command; this installs all Node packages and | |
# dependencies | |
yarn --immutable --network-timeout 120000 | |
- name: Build Positron | |
env: | |
npm_config_arch: ${{ matrix.arch }} | |
run: | | |
yarn gulp vscode-linux-${{ matrix.arch }} | |
- name: Prepare Linux packages | |
run: | | |
yarn gulp vscode-linux-${{ matrix.arch }}-prepare-deb | |
yarn gulp vscode-linux-${{ matrix.arch }}-prepare-rpm | |
# There is only .deb or .rpm file generated by the gulp "build" | |
# step. The `*` globs in the `mv` command will match a single | |
# file and are just a convenient way of matching the generated | |
# filename. | |
- name: Build binary | |
run: | | |
yarn gulp vscode-linux-${{ matrix.arch }}-build-deb | |
yarn gulp vscode-linux-${{ matrix.arch }}-build-rpm | |
mv .build/linux/deb/*/deb/*.deb Positron-${{ inputs.short_version }}.deb | |
mv .build/linux/rpm/*/*.rpm Positron-${{ inputs.short_version }}.rpm | |
- name: Upload .rpm | |
uses: actions/upload-artifact@v4 | |
with: | |
name: positron-binary-rpm | |
path: Positron-${{ inputs.short_version }}.rpm | |
- name: Upload .deb | |
uses: actions/upload-artifact@v4 | |
with: | |
name: positron-binary-deb | |
path: Positron-${{ inputs.short_version }}.deb | |
# Build the Remote Extension Host (REH) version of Positron. This | |
# contains the bits that are copied into SSH hosts or containers for | |
# remote development workflows. | |
- name: Build Positron Remote Extension Host | |
env: | |
npm_config_arch: ${{ matrix.arch }} | |
run: | | |
yarn gulp vscode-reh-linux-${{ matrix.arch }} | |
cd .. | |
tar czvf positron-reh-linux-${{ matrix.arch }}-${{ inputs.short_version }}.tar.gz vscode-reh-linux-${{ matrix.arch }} | |
- name: Upload REH .tar.gz | |
uses: actions/upload-artifact@v4 | |
with: | |
name: positron-binary-reh | |
path: ../positron-reh-linux-${{ matrix.arch }}-${{ inputs.short_version }}.tar.gz | |
status: | |
if: ${{ failure() }} | |
runs-on: ubuntu-latest | |
needs: build-binaries | |
steps: | |
- name: Notify slack if build fails | |
uses: slackapi/[email protected] | |
id: slack-failure | |
with: | |
payload: | | |
{ | |
"message": "Positron Linux build ${{ inputs.short_version }} failed", | |
"status": "Failure", | |
"run_url": "https://github.com/posit-dev/positron/actions/runs/${{ github.run_id }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |