mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-09-26 23:09:20 +08:00
Update build script
This commit is contained in:
parent
55e765e7f9
commit
b228255d3b
247
.github/workflows/build.yml
vendored
247
.github/workflows/build.yml
vendored
@ -12,112 +12,60 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux32_build:
|
linux_build:
|
||||||
name: Linux x86 Build
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch: x86
|
||||||
|
artifact: subconverter_linux32
|
||||||
|
- arch: amd64
|
||||||
|
artifact: subconverter_linux64
|
||||||
|
- arch: armv7
|
||||||
|
artifact: subconverter_armv7
|
||||||
|
- arch: aarch64
|
||||||
|
artifact: subconverter_aarch64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
name: Linux ${{ matrix.arch }} Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout base
|
||||||
|
uses: actions/checkout@v4
|
||||||
- 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:${{ matrix.arch }}-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@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: subconverter_linux32
|
name: ${{ matrix.artifact }}
|
||||||
path: subconverter/
|
path: subconverter/
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
run: tar czf subconverter_linux32.tar.gz subconverter
|
run: tar czf ${{ matrix.artifact }}.tar.gz subconverter
|
||||||
- name: Draft Release
|
- name: Draft Release
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: subconverter_linux32.tar.gz
|
files: ${{ matrix.artifact }}.tar.gz
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
linux64_build:
|
macos_build:
|
||||||
name: Linux x86_64 Build
|
strategy:
|
||||||
runs-on: ubuntu-latest
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch: x86
|
||||||
|
artifact: subconverter_darwin64
|
||||||
|
os: macos-13
|
||||||
|
- arch: arm
|
||||||
|
artifact: subconverter_darwinarm
|
||||||
|
os: macos-14
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
name: macOS ${{ matrix.arch }} Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout base
|
||||||
- name: Add commit id into version
|
uses: actions/checkout@v4
|
||||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
- name: Setup Python
|
||||||
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
|
uses: actions/setup-python@v5
|
||||||
- name: Build
|
|
||||||
run: docker run --rm -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
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: subconverter_linux64
|
|
||||||
path: subconverter/
|
|
||||||
- name: Package Release
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
run: tar czf subconverter_linux64.tar.gz subconverter
|
|
||||||
- name: Draft Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
with:
|
|
||||||
files: subconverter_linux64.tar.gz
|
|
||||||
draft: true
|
|
||||||
|
|
||||||
armv7_build:
|
|
||||||
name: Linux armv7 Build
|
|
||||||
runs-on: [self-hosted, linux, ARM]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- 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 --rm -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: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: subconverter_armv7
|
|
||||||
path: subconverter/
|
|
||||||
- name: Package Release
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
run: tar czf subconverter_armv7.tar.gz subconverter
|
|
||||||
- name: Draft Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
with:
|
|
||||||
files: subconverter_armv7.tar.gz
|
|
||||||
draft: true
|
|
||||||
|
|
||||||
aarch64_build:
|
|
||||||
name: Linux aarch64 Build
|
|
||||||
runs-on: [self-hosted, linux, ARM64]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- 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 --rm -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: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: subconverter_aarch64
|
|
||||||
path: subconverter/
|
|
||||||
- name: Package Release
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
run: tar czf subconverter_aarch64.tar.gz subconverter
|
|
||||||
- name: Draft Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
with:
|
|
||||||
files: subconverter_aarch64.tar.gz
|
|
||||||
draft: true
|
|
||||||
|
|
||||||
macos_x86_build:
|
|
||||||
name: macOS x86 Build
|
|
||||||
runs-on: macos-13
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Add commit id into version
|
- name: Add commit id into version
|
||||||
@ -126,67 +74,54 @@ jobs:
|
|||||||
- 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@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: subconverter_darwin64
|
name: ${{ matrix.artifact }}
|
||||||
path: subconverter/
|
path: subconverter/
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
run: tar czf subconverter_darwin64.tar.gz subconverter
|
run: tar czf ${{ matrix.artifact }}.tar.gz subconverter
|
||||||
- name: Draft Release
|
- name: Draft Release
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: subconverter_darwin64.tar.gz
|
files: ${{ matrix.artifact }}.tar.gz
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
macos_arm_build:
|
windows_build:
|
||||||
name: macOS ARM Build
|
strategy:
|
||||||
runs-on: macos-14
|
matrix:
|
||||||
steps:
|
include:
|
||||||
- uses: actions/checkout@v3
|
- arch: x86
|
||||||
- uses: actions/setup-python@v4
|
artifact: subconverter_win32
|
||||||
with:
|
env: i686
|
||||||
python-version: '3.11'
|
msystem: MINGW32
|
||||||
- name: Add commit id into version
|
- arch: amd64
|
||||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
artifact: subconverter_win64
|
||||||
run: SHA=$(git rev-parse --short HEAD) && sed -i -e 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
|
env: x86_64
|
||||||
- name: Build
|
msystem: MINGW64
|
||||||
run: bash scripts/build.macos.release.sh
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: subconverter_darwinarm
|
|
||||||
path: subconverter/
|
|
||||||
- name: Package Release
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
run: tar czf subconverter_darwinarm.tar.gz subconverter
|
|
||||||
- name: Draft Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
with:
|
|
||||||
files: subconverter_darwinarm.tar.gz
|
|
||||||
draft: true
|
|
||||||
|
|
||||||
windows64_build:
|
|
||||||
name: Windows x86_64 Build
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
name: Windows ${{ matrix.arch }} Build
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout base
|
||||||
- uses: actions/setup-python@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- uses: actions/setup-node@v3
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
- uses: msys2/setup-msys2@v2
|
- name: Setup MSYS2
|
||||||
|
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-pcre2 patch
|
install: base-devel git mingw-w64-${{ matrix.env }}-gcc mingw-w64-${{ matrix.env }}-cmake mingw-w64-${{ matrix.env }}-pcre2 patch
|
||||||
msystem: MINGW64
|
msystem: ${{ matrix.msystem }}
|
||||||
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/') }}
|
||||||
@ -194,56 +129,16 @@ jobs:
|
|||||||
- 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@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: subconverter_win64
|
name: ${{ matrix.artifact }}
|
||||||
path: subconverter/
|
path: subconverter/
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
run: 7z a subconverter_win64.7z subconverter/
|
run: 7z a ${{ matrix.artifact }}.7z subconverter/
|
||||||
- name: Draft Release
|
- name: Draft Release
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: subconverter_win64.7z
|
files: ${{ matrix.artifact }}.7z
|
||||||
draft: true
|
|
||||||
|
|
||||||
windows32_build:
|
|
||||||
name: Windows x86 Build
|
|
||||||
runs-on: windows-latest
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: msys2 {0}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
update: true
|
|
||||||
install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-pcre2 patch
|
|
||||||
msystem: MINGW32
|
|
||||||
path-type: inherit
|
|
||||||
- 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: bash scripts/build.windows.release.sh
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: subconverter_win32
|
|
||||||
path: subconverter/
|
|
||||||
- name: Package Release
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
run: 7z a subconverter_win32.7z subconverter/
|
|
||||||
- name: Draft Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
with:
|
|
||||||
files: subconverter_win32.7z
|
|
||||||
draft: true
|
draft: true
|
||||||
|
Loading…
Reference in New Issue
Block a user