65 lines
2.3 KiB
Text
65 lines
2.3 KiB
Text
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: uraimo/run-on-arch-action@v2
|
|
if: ${{ matrix.arch }} != x86_64
|
|
name: Build artifact
|
|
id: build
|
|
with:
|
|
arch: ${{ matrix.arch }}
|
|
distro: ${{ matrix.distro }}
|
|
|
|
# Not required, but speeds up builds
|
|
githubToken: ${{ github.token }}
|
|
|
|
# Set an output parameter `uname` for use in subsequent steps
|
|
run: |
|
|
uname -a
|
|
echo ::set-output name=uname::$(uname -a)
|
|
|
|
# Create an artifacts directory
|
|
setup: |
|
|
mkdir -p "${PWD}/artifacts"
|
|
|
|
# Mount the artifacts directory as /artifacts in the container
|
|
dockerRunArgs: |
|
|
--volume "${PWD}/artifacts:/artifacts"
|
|
|
|
# Pass some environment variables to the container
|
|
env: | # YAML, but pipe character is necessary
|
|
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
|
|
|
|
# The shell to run commands with in the container
|
|
shell: /bin/sh
|
|
|
|
# Install some dependencies in the container. This speeds up builds if
|
|
# you are also using githubToken. Any dependencies installed here will
|
|
# be part of the container image that gets cached, so subsequent
|
|
# builds don't have to re-install them. The image layer is cached
|
|
# publicly in your project's package repository, so it is vital that
|
|
# no secrets are present in the container state or logs.
|
|
install: |
|
|
case "${{ matrix.distro }}" in
|
|
ubuntu*|jessie|stretch|buster|bullseye)
|
|
apt-get update -q -y
|
|
apt-get install -q -y git
|
|
;;
|
|
fedora*)
|
|
dnf -y update
|
|
dnf -y install git which
|
|
;;
|
|
alpine*)
|
|
apk update
|
|
apk add git
|
|
;;
|
|
esac
|
|
|
|
# Produce a binary artifact and place it in the mounted volume
|
|
run: |
|
|
cp $(which git) "/artifacts/${artifact_name}"
|
|
echo "Produced artifact at /artifacts/${artifact_name}"
|
|
|
|
- name: Show the artifact
|
|
# Items placed in /artifacts in the container will be in
|
|
# ${PWD}/artifacts on the host.
|
|
run: |
|
|
ls -al "${PWD}/artifacts"
|