Skip to content

Commit

Permalink
inital import
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Aug 24, 2023
0 parents commit 5aaed1c
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/actions/setup-xcc/action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -eu -x

RELEASE=https://github.com/kentik/musl-xcc/releases/download/$VERSION/
ARCHIVE=xcc-$TARGET.tar.gz

curl -sL $RELEASE/$ARCHIVE | tar -xzf - -C /

echo "CC=/opt/xcc/bin/$TARGET-gcc" >> $GITHUB_ENV
echo "CXX=/opt/xcc/bin/$TARGET-g++" >> $GITHUB_ENV
echo "AR=/opt/xcc/bin/$TARGET-ar" >> $GITHUB_ENV
echo "LD=/opt/xcc/bin/$TARGET-ld" >> $GITHUB_ENV
echo "RANLIB=/opt/xcc/bin/$TARGET-ranlib" >> $GITHUB_ENV
16 changes: 16 additions & 0 deletions .github/actions/setup-xcc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: package

inputs:
target:
required: true
version:
required: true

runs:
using: composite
steps:
- run: $GITHUB_ACTION_PATH/action.sh
shell: bash
env:
TARGET: ${{ inputs.target }}
VERSION: ${{ inputs.version }}
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: build

on:
push:
branches: "*"

jobs:
build:
strategy:
matrix:
target:
- aarch64-linux-musl
- armv7-linux-musleabihf
- x86_64-linux-musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: ./.github/actions/setup-xcc
with:
target: ${{ matrix.target }}
version: f9cb5162
- name: build libpcap
run: |
./configure --build=$BUILD --host=$HOST --with-pcap=linux --disable-shared
make
mv libpcap.a libpcap-$HOST.a
env:
BUILD: x86_64-pc-linux-gnu
HOST: ${{ matrix.target }}
working-directory: libpcap
- uses: actions/upload-artifact@v3
with:
name: libpcap-${{ matrix.target }}.a
path: libpcap/libpcap-${{ matrix.target }}.a

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
- uses: actions/github-script@v6
with:
script: |
const version = context.sha.substring(0, 8);
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${version}`,
sha: context.sha
});
core.setOutput('version', version);
id: create-tag
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.create-tag.outputs.version }}
files: artifacts/**/*
needs: build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libpcap"]
path = libpcap
url = https://github.com/the-tcpdump-group/libpcap.git
1 change: 1 addition & 0 deletions libpcap
Submodule libpcap added at 371b9e

0 comments on commit 5aaed1c

Please sign in to comment.