lsquic-static-alpine/.github/workflows/build.yml

134 lines
3.6 KiB
YAML
Raw Normal View History

2020-12-30 08:29:12 +00:00
name: Build liblsquic.a
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
2022-08-04 15:49:03 +00:00
container: alpine:3.14
2020-12-30 08:29:12 +00:00
outputs:
LSQUIC_COMMIT: ${{ env.LSQUIC_COMMIT }}
LSQUIC_VERSION: ${{ env.LSQUIC_VERSION }}
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
steps:
- name: Install action dependencies
2022-08-04 15:49:03 +00:00
run: |
apk add \
binutils \
bsd-compat-headers \
build-base \
cmake \
git \
go \
libevent-dev \
linux-headers \
ninja \
perl \
tar \
zlib-dev \
zlib-static
2020-12-30 08:29:12 +00:00
- uses: actions/checkout@v2
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Load BORINGSSL_COMMIT and LSQUIC_COMMIT
run: ./env.sh
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Cache BoringSSL
id: cache-boringssl
uses: actions/cache@v2
with:
path: ./boringssl
key: boringssl-${{ env.BORINGSSL_COMMIT }}
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Build BoringSSL
if: steps.cache-boringssl.outputs.cache-hit != 'true'
run: |
git clone https://boringssl.googlesource.com/boringssl
cd boringssl
git checkout $BORINGSSL_COMMIT
cmake -DCMAKE_BUILD_TYPE=Release -GNinja .
ninja
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Build LSQUIC
if: steps.cache-lsquic.outputs.cache-hit != 'true'
run: |
git clone https://github.com/litespeedtech/lsquic.git
cd lsquic
git checkout $LSQUIC_COMMIT
git submodule init
git submodule update
cmake -DBORINGSSL_DIR=../boringssl .
make
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Test LSQUIC
if: steps.cache-lsquic.outputs.cache-hit != 'true'
run: |
cd lsquic
make test
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Set LSQUIC_VERSION
run: |
cd lsquic
LSQUIC_VERSION=$(git describe --contains $LSQUIC_COMMIT)
echo "LSQUIC_VERSION=$LSQUIC_VERSION" >> $GITHUB_ENV
echo "LSQUIC_VERSION=$LSQUIC_VERSION"
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Prepare artifact / release asset
run: |
mkdir dist
cd dist
ar -x ../boringssl/ssl/libssl.a
ar -x ../boringssl/crypto/libcrypto.a
ar -x ../lsquic/src/liblsquic/liblsquic.a
ar rc liblsquic.a *.o
rm *.o
strip --strip-unneeded liblsquic.a
ranlib liblsquic.a
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
echo "liblsquic.a $LSQUIC_VERSION (https://github.com/litespeedtech/lsquic/commit/$LSQUIC_COMMIT)" > version.txt
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- uses: actions/upload-artifact@v2
with:
name: liblsquic.zip
path: dist/
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
release:
runs-on: ubuntu-latest
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
needs: build
env:
LSQUIC_VERSION: ${{ needs.build.outputs.LSQUIC_VERSION }}
LSQUIC_COMMIT: ${{ needs.build.outputs.LSQUIC_COMMIT }}
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
steps:
- uses: actions/download-artifact@v2
with:
name: liblsquic.zip
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LSQUIC_VERSION }}
release_name: ${{ env.LSQUIC_VERSION }}
body: liblsquic.a ${{ env.LSQUIC_VERSION }} (https://github.com/litespeedtech/lsquic/commit/${{ env.LSQUIC_COMMIT }})
2022-08-04 15:49:03 +00:00
2020-12-30 08:29:12 +00:00
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: liblsquic.a
asset_name: liblsquic.a
asset_content_type: application/x-archive