This commit is contained in:
Larvan2 2023-03-05 23:53:34 +08:00
parent 2c777dd8ca
commit d856bf7da7
6 changed files with 181 additions and 210 deletions

View File

@ -1,5 +1,9 @@
name: GitHub CI name: GitHub CI
on: [ push ] on:
push:
branches: [ master ]
workflow_dispatch:
pull_request:
concurrency: concurrency:
group: ${{ github.ref }}-${{ github.workflow }} group: ${{ github.ref }}-${{ github.workflow }}
@ -21,152 +25,131 @@ jobs:
name: Linux x86 Build name: Linux x86 Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Add commit id into version - name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build - name: Build
run: docker run --rm -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:x86-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh" run: docker run --rm -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:x86-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
- name: Upload - name: Upload
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v3
with: with:
name: subconverter_linux32 name: subconverter_linux32
path: subconverter/ path: subconverter/
- name: Package Release - name: Package Release
run: tar czf subconverter_linux32.tar.gz subconverter if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Draft Release run: tar czf subconverter_linux32.tar.gz subconverter
uses: softprops/action-gh-release@v1 - name: Draft Release
with: uses: softprops/action-gh-release@v1
files: subconverter_linux32.tar.gz if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
release: true with:
tag_name: Alpha files: subconverter_linux32.tar.gz
draft: true
tag_name: Alpha
linux64_build: linux64_build:
name: Linux x86_64 Build name: Linux x86_64 Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Add commit id into version - name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build - name: Build
run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:amd64-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh" run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:amd64-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
- name: Upload - name: Upload
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v3
with: with:
name: subconverter_linux64 name: subconverter_linux64
path: subconverter/ path: subconverter/
- name: Package Release - name: Package Release
run: tar czf subconverter_linux64.tar.gz subconverter if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Draft Release run: tar czf subconverter_linux64.tar.gz subconverter
uses: softprops/action-gh-release@v1 - name: Draft Release
with: uses: softprops/action-gh-release@v1
files: subconverter_linux64.tar.gz if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
release: true with:
tag_name: Alpha files: subconverter_linux64.tar.gz
draft: true
tag_name: Alpha
armv7_build: armv7_build:
name: Linux armv7 Build name: Linux armv7 Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up QEMU - name: Add commit id into version
uses: docker/setup-qemu-action@v1 if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Add commit id into version run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
if: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Build
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:armv7-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
- name: Build - name: Upload
run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:armv7-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh" uses: actions/upload-artifact@v3
- name: Upload with:
uses: actions/upload-artifact@v1 name: subconverter_armv7
with: path: subconverter/
name: subconverter_armv7 - name: Package Release
path: subconverter/ if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Package Release run: tar czf subconverter_armv7.tar.gz subconverter
run: tar czf subconverter_armv7.tar.gz subconverter - name: Draft Release
- name: Draft Release uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v1 if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with: with:
files: subconverter_armv7.tar.gz files: subconverter_armv7.tar.gz
release: true draft: true
tag_name: Alpha tag_name: Alpha
armhf_build:
name: Linux armhf Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build
run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:armhf-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
- name: Upload
uses: actions/upload-artifact@v1
with:
name: subconverter_armhf
path: subconverter/
- name: Package Release
run: tar czf subconverter_armhf.tar.gz subconverter
- name: Draft Release
uses: softprops/action-gh-release@v1
with:
files: subconverter_armhf.tar.gz
release: true
tag_name: Alpha
aarch64_build: aarch64_build:
name: Linux aarch64 Build name: Linux aarch64 Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up QEMU - name: Add commit id into version
uses: docker/setup-qemu-action@v1 if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Add commit id into version run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
if: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Build
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:aarch64-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
- name: Build - name: Upload
run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:aarch64-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh" uses: actions/upload-artifact@v3
- name: Upload with:
uses: actions/upload-artifact@v1 name: subconverter_aarch64
with: path: subconverter/
name: subconverter_aarch64 - name: Package Release
path: subconverter/ if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Package Release run: tar czf subconverter_aarch64.tar.gz subconverter
run: tar czf subconverter_aarch64.tar.gz subconverter - name: Draft Release
- name: Draft Release uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v1 if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with: with:
files: subconverter_aarch64.tar.gz files: subconverter_aarch64.tar.gz
release: true draft: true
tag_name: Alpha tag_name: Alpha
macos_build: macos_build:
name: macOS Build name: macOS Build
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Add commit id into version - name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i -e 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: SHA=$(git rev-parse --short HEAD) && sed -i -e 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build - name: Build
run: bash scripts/build.macos.release.sh run: bash scripts/build.macos.release.sh
- name: Upload - name: Upload
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v3
with: with:
name: subconverter_darwin64 name: subconverter_darwin64
path: subconverter/ path: subconverter/
- name: Package Release - name: Package Release
run: tar czf subconverter_darwin64.tar.gz subconverter if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Draft Release run: tar czf subconverter_darwin64.tar.gz subconverter
uses: softprops/action-gh-release@v1 - name: Draft Release
with: uses: softprops/action-gh-release@v1
files: subconverter_darwin64.tar.gz if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
release: true with:
tag_name: Alpha files: subconverter_darwin64.tar.gz
draft: true
tag_name: Alpha
windows64_build: windows64_build:
name: Windows x86_64 Build name: Windows x86_64 Build
@ -175,34 +158,36 @@ jobs:
run: run:
shell: msys2 {0} shell: msys2 {0}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2-beta - uses: actions/setup-node@v3
with: with:
node-version: '16' node-version: '16'
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
update: true update: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 patch install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 patch
msystem: MINGW64 msystem: MINGW64
path-type: inherit path-type: inherit
- name: Add commit id into version - name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build - name: Build
run: bash scripts/build.windows.release.sh run: bash scripts/build.windows.release.sh
- name: Upload - name: Upload
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v3
with: with:
name: subconverter_win64 name: subconverter_win64
path: subconverter/ path: subconverter/
- name: Package Release - name: Package Release
run: 7z a subconverter_win64.7z subconverter/ if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Draft Release run: 7z a subconverter_win64.7z subconverter/
uses: softprops/action-gh-release@v1 - name: Draft Release
with: uses: softprops/action-gh-release@v1
files: subconverter_win64.7z if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
release: true with:
tag_name: Alpha files: subconverter_win64.7z
draft: true
tag_name: Alpha
windows32_build: windows32_build:
name: Windows x86 Build name: Windows x86 Build
@ -211,32 +196,33 @@ jobs:
run: run:
shell: msys2 {0} shell: msys2 {0}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2-beta - uses: actions/setup-node@v3
with: with:
node-version: '16' node-version: '16'
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
update: true update: true
install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 patch install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 patch
msystem: MINGW32 msystem: MINGW32
path-type: inherit path-type: inherit
- name: Add commit id into version - name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build - name: Build
run: bash scripts/build.windows.release.sh run: bash scripts/build.windows.release.sh
- name: Upload - name: Upload
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v3
with: with:
name: subconverter_win32 name: subconverter_win32
path: subconverter/ path: subconverter/
- name: Package Release - name: Package Release
run: 7z a subconverter_win32.7z subconverter/ if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
- name: Draft Release run: 7z a subconverter_win32.7z subconverter/
uses: softprops/action-gh-release@v1 - name: Draft Release
with: uses: softprops/action-gh-release@v1
files: subconverter_win32.7z if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
release: true with:
tag_name: Alpha files: subconverter_win32.7z
draft: true
tag_name: Alpha

View File

@ -30,7 +30,7 @@ RUN apk add --no-cache --virtual .build-tools git g++ build-base linux-headers c
cd .. && \ cd .. && \
git clone https://github.com/ToruNiina/toml11 --depth=1 && \ git clone https://github.com/ToruNiina/toml11 --depth=1 && \
cd toml11 && \ cd toml11 && \
cmake . && \ cmake -DCMAKE_CXX_STANDARD=11 . && \
make install -j $THREADS && \ make install -j $THREADS && \
cd .. && \ cd .. && \
git clone https://github.com/tindy2013/subconverter --depth=1 && \ git clone https://github.com/tindy2013/subconverter --depth=1 && \

View File

@ -30,17 +30,12 @@ git clone https://github.com/PerMalmberg/libcron --depth=1
cd libcron cd libcron
git submodule update --init git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release . cmake -DCMAKE_BUILD_TYPE=Release .
make libcron -j2 make libcron install -j2
install -m644 libcron/out/Release/liblibcron.a /usr/lib/
install -d /usr/include/libcron/
install -m644 libcron/include/libcron/* /usr/include/libcron/
install -d /usr/include/date/
install -m644 libcron/externals/date/include/date/* /usr/include/date/
cd .. cd ..
git clone https://github.com/ToruNiina/toml11 --depth=1 git clone https://github.com/ToruNiina/toml11 --depth=1
cd toml11 cd toml11
cmake -DCMAKE_CXX_STANDARD=17 . cmake -DCMAKE_CXX_STANDARD=11 .
make install -j4 make install -j4
cd .. cd ..

View File

@ -31,7 +31,7 @@ git clone https://github.com/PerMalmberg/libcron --depth=1
cd libcron cd libcron
git submodule update --init git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release . cmake -DCMAKE_BUILD_TYPE=Release .
make libcron -j8 make libcron install -j8
install -m644 libcron/out/Release/liblibcron.a /usr/local/lib/ install -m644 libcron/out/Release/liblibcron.a /usr/local/lib/
install -d /usr/local/include/libcron/ install -d /usr/local/include/libcron/
install -m644 libcron/include/libcron/* /usr/local/include/libcron/ install -m644 libcron/include/libcron/* /usr/local/include/libcron/
@ -41,7 +41,7 @@ cd ..
git clone https://github.com/ToruNiina/toml11 --depth=1 git clone https://github.com/ToruNiina/toml11 --depth=1
cd toml11 cd toml11
cmake -DCMAKE_CXX_STANDARD=17 . cmake -DCMAKE_CXX_STANDARD=11 .
make install -j4 make install -j4
cd .. cd ..

View File

@ -27,13 +27,8 @@ cd ..
git clone https://github.com/PerMalmberg/libcron --depth=1 git clone https://github.com/PerMalmberg/libcron --depth=1
cd libcron cd libcron
git submodule update --init git submodule update --init
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release . cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" .
make libcron -j4 make libcron install -j4
install -m644 libcron/out/Release/liblibcron.a "$MINGW_PREFIX/lib/"
install -d "$MINGW_PREFIX/include/libcron/"
install -m644 libcron/include/libcron/* "$MINGW_PREFIX/include/libcron/"
install -d "$MINGW_PREFIX/include/date/"
install -m644 libcron/externals/date/include/date/* "$MINGW_PREFIX/include/date/"
cd .. cd ..
git clone https://github.com/Tencent/rapidjson --depth=1 git clone https://github.com/Tencent/rapidjson --depth=1
@ -44,7 +39,7 @@ cd ..
git clone https://github.com/ToruNiina/toml11 --depth=1 git clone https://github.com/ToruNiina/toml11 --depth=1
cd toml11 cd toml11
cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" . cmake -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=11 .
make install -j4 make install -j4
cd .. cd ..

View File

@ -29,17 +29,12 @@ cd ..
git clone https://github.com/PerMalmberg/libcron --depth=1 git clone https://github.com/PerMalmberg/libcron --depth=1
cd libcron cd libcron
git submodule update --init git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release . cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .
make libcron -j3 make libcron install -j3
install -m644 libcron/out/Release/liblibcron.a $PREFIX/lib/
install -d $PREFIX/include/libcron/
install -m644 libcron/include/libcron/* $PREFIX/include/libcron/
install -d $PREFIX/include/date/
install -m644 libcron/externals/date/include/date/* $PREFIX/include/date/
cd .. cd ..
git clone https://github.com/ToruNiina/toml11 --depth=1 git clone https://github.com/ToruNiina/toml11 --depth=1
cd toml11 cd toml11
cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=$PREFIX . cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_CXX_STANDARD=11 .
make install -j3 make install -j3
cd .. cd ..