-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (65 loc) · 2.11 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build container images
on:
workflow_dispatch:
inputs:
useCache:
description: Use GHA cache
type: boolean
required: false
default: true
push:
paths:
- ".github/workflows/build.yml"
- "Dockerfile"
- "*.sh"
pull_request:
paths:
- ".github/workflows/build.yml"
- "Dockerfile"
- "build.sh"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: python_hyperscan
jobs:
build_manylinux:
name: ${{ matrix.policy }}_${{ matrix.platform }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
policy: ["manylinux2014", "manylinux_2_28", "musllinux_1_1"]
platform: ["x86_64", "aarch64"]
env:
POLICY: ${{ matrix.policy }}
PLATFORM: ${{ matrix.platform }}
COMMIT_SHA: ${{ github.sha }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Set up emulation
if: matrix.platform != 'i686' && matrix.platform != 'x86_64'
uses: docker/[email protected]
with:
platforms: ${{ matrix.platform }}
- name: Setup cache
if: github.event_name != 'workflow_dispatch' || fromJSON(github.event.inputs.useCache)
uses: actions/[email protected]
with:
path: .buildx-cache-${{ matrix.policy }}_${{ matrix.platform }}/*
key: buildx-cache-${{ matrix.policy }}-${{ matrix.platform }}-${{ hashFiles('Dockerfile') }}
restore-keys: buildx-cache-${{ matrix.policy }}-${{ matrix.platform }}-
- name: Build
run: ./build.sh
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'darvid/manylinux-hyperscan'
run: ./deploy.sh