v0.11.0-a1 性能优化: #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub CI | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '**' | |
workflow_dispatch: | |
# pull_request: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
linux_build: | |
strategy: | |
matrix: | |
include: | |
- arch: amd64 | |
artifact: subconverter_linux64 | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
name: Linux ${{ matrix.arch }} Build | |
steps: | |
- name: Checkout base | |
uses: actions/checkout@v4 | |
- 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:${{ 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 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact }} | |
path: subconverter/ | |
- name: Package Release | |
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} | |
run: tar czf ${{ matrix.artifact }}.tar.gz subconverter | |
- name: Draft Release | |
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ${{ matrix.artifact }}.tar.gz | |
draft: true |