Skip to content

Update release.yml #335

Update release.yml

Update release.yml #335

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
workflow_call:
jobs:
shellcheck:
permissions:
contents: read
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Run ShellCheck
run: |
sudo apt-get install shellcheck
shopt -s globstar; shellcheck script/**/*.sh
build:
permissions:
contents: read
name: ${{ matrix.friendlyName }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-2025, ubuntu-22.04]
arch: [x86, x64, arm64]
include:
- os: macos-13
friendlyName: macOS
targetPlatform: macOS
- os: windows-2025
friendlyName: Windows
targetPlatform: win32
- os: ubuntu-22.04
friendlyName: Linux
targetPlatform: ubuntu
- os: ubuntu-22.04
friendlyName: Linux
targetPlatform: ubuntu
arch: arm
exclude:
- os: macos-13
arch: x86
timeout-minutes: 20
steps:
- name: Install dependencies into dockerfile on Ubuntu
if: matrix.targetPlatform == 'ubuntu'
run: |
# ubuntu dockerfile is very minimal (only 122 packages are installed)
# add dependencies expected by scripts
sudo apt update
sudo apt install -y software-properties-common lsb-release sudo wget curl build-essential jq autoconf automake pkg-config ca-certificates
# install new enough git to run actions/checkout
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install -y git
# install new enough npm/nodejs to build dugite-native
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# avoid "fatal: detected dubious ownership in repository at '/__w/dugite-native/dugite-native'" error
git config --global --add safe.directory '*'
# We need to use macos-14 14.1 for maximum compatibility with older macOS (x64)
- name: Switch to Xcode 14.1
if: matrix.targetPlatform == 'macOS' && matrix.arch == 'x64'
run: |
sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer/
# Delete the command line tools to make sure they don't get our builds
# messed up with macOS SDK 11 stuff.
sudo rm -rf /Library/Developer/CommandLineTools
- uses: actions/checkout@v3
with:
submodules: recursive
# Needed for script/package.sh to work
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- name: Check formatting
run: npm run prettier
- name: Build tools
run: npm run check
- name: Install extra dependencies for building Git on Ubuntu (x64)
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'x64'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-gnutls-dev libexpat1-dev zlib1g-dev gettext libssl-dev
- name: Install extra dependencies for building Git on Ubuntu (x86)
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-i686-linux-gnu binutils-i686-gnu libcurl4-gnutls-dev:i386 zlib1g-dev:i386 libssl-dev:i386 gettext
- name: Install extra dependencies for building Git on Ubuntu (arm64)
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'arm64'
run: |
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libcurl4-gnutls-dev:arm64 zlib1g-dev:arm64 libssl-dev:arm64 gettext
- name: Install extra dependencies for building Git on Ubuntu (arm)
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'arm'
run: |
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libcurl4-gnutls-dev:armhf zlib1g-dev:armhf libssl-dev:armhf gettext
- name: Build
shell: bash
run: script/build.sh
env:
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Package
shell: bash
run: script/package.sh
env:
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Upload output artifacts
uses: actions/upload-artifact@v4
with:
name:
dugite-native-${{ matrix.targetPlatform }}-${{ matrix.arch }}-output
path: ./output
retention-days: 5