mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-01 09:14:15 +00:00
Add specifying Docker build concurrent jobs
Add limiting concurrent jobs in Actions
This commit is contained in:
3 files changed
+14
-5
No files matched your search
@@ -1,6 +1,10 @@
|
||||
name: GitHub CI
|
||||
on: [push]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
linux32_build:
|
||||
name: Linux x86 Build
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Publish Docker Image
|
||||
on: [push]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
@@ -30,7 +34,7 @@ jobs:
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
SHA=$(git rev-parse --short HEAD)
|
||||
docker buildx build --build-arg SHA="$SHA" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64,linux/386 --tag tindy2013/subconverter:latest scripts/
|
||||
docker buildx build --build-arg SHA="$SHA" THREADS=1 --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64,linux/386 --tag tindy2013/subconverter:latest scripts/
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
+5
-4
@@ -1,5 +1,6 @@
|
||||
FROM alpine:3.13
|
||||
LABEL maintainer "tindy.it@gmail.com"
|
||||
ARG THREADS="4"
|
||||
ARG SHA=""
|
||||
|
||||
# build minimized
|
||||
@@ -10,7 +11,7 @@ RUN apk add --no-cache --virtual .build-tools git g++ build-base linux-headers c
|
||||
cd quickjspp && \
|
||||
git submodule update --init && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release . && \
|
||||
make quickjs -j2 && \
|
||||
make quickjs -j $THREADS && \
|
||||
install -m644 quickjs/libquickjs.a /usr/lib && \
|
||||
install -d /usr/include/quickjs/ && \
|
||||
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/include/quickjs/ && \
|
||||
@@ -20,7 +21,7 @@ RUN apk add --no-cache --virtual .build-tools git g++ build-base linux-headers c
|
||||
cd libcron && \
|
||||
git submodule update --init && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release . && \
|
||||
make libcron -j4 && \
|
||||
make libcron -j $THREADS && \
|
||||
install -m644 libcron/out/Release/liblibcron.a /usr/lib/ && \
|
||||
install -d /usr/include/libcron/ && \
|
||||
install -m644 libcron/include/libcron/* /usr/include/libcron/ && \
|
||||
@@ -30,13 +31,13 @@ RUN apk add --no-cache --virtual .build-tools git g++ build-base linux-headers c
|
||||
git clone https://github.com/ToruNiina/toml11 --depth=1 && \
|
||||
cd toml11 && \
|
||||
cmake . && \
|
||||
make install -j4 && \
|
||||
make install -j $THREADS && \
|
||||
cd .. && \
|
||||
git clone https://github.com/tindy2013/subconverter --depth=1 && \
|
||||
cd subconverter && \
|
||||
[ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\
|
||||
cmake -DCMAKE_BUILD_TYPE=Release . && \
|
||||
make -j4 && \
|
||||
make -j $THREADS && \
|
||||
mv subconverter /usr/bin && \
|
||||
mv base ../ && \
|
||||
cd .. && \
|
||||
|
||||
Reference in new issue
Block a user