This commit is contained in:
Jesse Bannon 2023-02-22 17:46:30 -08:00
parent 9e15bb18d7
commit f394af6eb1

View file

@ -53,8 +53,8 @@ jobs:
################################################################################################## ##################################################################################################
build-unix: build-linux:
name: build-unix name: build-linux
needs: needs:
- version - version
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -71,11 +71,14 @@ jobs:
sudo apt-get -y install zip sudo apt-get -y install zip
pip install -e .[build] pip install -e .[build]
EXEC_SUFFIX=_linux make executable EXEC_SUFFIX=_linux make executable
- name: Upload artifacts mkdir -p /opt/builds
uses: actions/upload-artifact@v3 mv dist/ytdl-sub_linux /opt/builds
- name: Save build to cache
uses: actions/cache@v3
with: with:
path: | path: /opt/builds/ytdl-sub_linux
dist/ytdl-sub_linux key: ${{ github.sha }}-linux
build-arm: build-arm:
name: build-arm name: build-arm
@ -99,22 +102,22 @@ jobs:
# Mount the artifacts directory as /artifacts in the container # Mount the artifacts directory as /artifacts in the container
dockerRunArgs: | dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts" --volume "/opt/builds:/artifacts"
# Set an output parameter `uname` for use in subsequent steps # Set an output parameter `uname` for use in subsequent steps
run: | run: |
apk add python3 python3-dev py3-pip musl-dev libc-dev libffi-dev gcc g++ pwgen apk add python3 python3-dev py3-pip musl-dev libc-dev libffi-dev gcc g++ pwgen zlib-dev
pip3 install --upgrade pip pip3 install --upgrade pip
pip3 install -e . pip3 install -e .
pip3 install pyinstaller pip3 install pyinstaller
pyinstaller --log-level=DEBUG ytdl-sub.spec pyinstaller --log-level=DEBUG ytdl-sub.spec
mv dist/ytdl-sub /artifacts/ytdl-sub_${{ matrix.arch }} mv dist/ytdl-sub /artifacts/ytdl-sub_${{ matrix.arch }}
- name: Upload artifacts - name: Save build to cache
uses: actions/upload-artifact@v3 uses: actions/cache@v3
with: with:
path: | path: /opt/builds/ytdl-sub_${{ matrix.arch }}
artifacts/ytdl-sub_${{ matrix.arch }} key: ${{ github.sha }}-${{ matrix.arch }}
################################################################################################## ##################################################################################################
@ -122,12 +125,39 @@ jobs:
name: github-release name: github-release
needs: needs:
- version - version
- build-linux
- build-arm
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Write version to init file - name: Write version to init file
run: | run: |
echo '${{ needs.version.outputs.init_contents }}' > src/ytdl_sub/__init__.py echo '${{ needs.version.outputs.init_contents }}' > src/ytdl_sub/__init__.py
- name: Restore linux build
uses: actions/cache@v3
with:
path: /opt/builds/ytdl-sub_linux
key: ${{github.sha}}-linux
- name: Restore aarch64 build
uses: actions/cache@v3
with:
path: /opt/builds/ytdl-sub_aarch64
key: ${{github.sha}}-aarch64
- name: Restore armv7 build
uses: actions/cache@v3
with:
path: /opt/builds/ytdl-sub_armv7
key: ${{github.sha}}-armv7
- name: Restore armv6 build
uses: actions/cache@v3
with:
path: /opt/builds/ytdl-sub_armv6
key: ${{github.sha}}-armv6
- name: Create Release - name: Create Release
if: ${{ github.ref == 'refs/heads/master' }} if: ${{ github.ref == 'refs/heads/master' }}
id: create_release id: create_release
@ -139,6 +169,11 @@ jobs:
See https://github.com/jmbannon/ytdl-sub#installation for installation steps See https://github.com/jmbannon/ytdl-sub#installation for installation steps
draft: false draft: false
prerelease: false prerelease: false
files: |
/opt/builds/ytdl-sub_linux
/opt/builds/ytdl-sub_aarch64
/opt/builds/ytdl-sub_armv7
/opt/builds/ytdl-sub_armv6
pypi-publish: pypi-publish:
name: pypi-publish name: pypi-publish