release #18
This file contains hidden or 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: release | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| inputs: | |
| version_tag: | |
| description: 'Version to publish (e.g. 0.0.9)' | |
| required: true | |
| default: '0.0.9' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: temurin | |
| - name: Cache pre-built native libraries (Prefix) | |
| uses: actions/cache@v4 | |
| with: | |
| path: buildscripts/prefix/ | |
| key: "release-prefix-v1-${{ hashFiles('buildscripts/include/depinfo.sh', 'buildscripts/scripts/*.sh') }}" | |
| restore-keys: "release-prefix-v1-" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install autoconf pkg-config pkgconf libtool ninja-build python3-pip gperf nasm | |
| sudo pip3 install meson | |
| - name: Download SDK and dependency sources | |
| run: | | |
| cd buildscripts | |
| IN_CI=1 ./download.sh > /dev/null | |
| - name: Set version tag | |
| run: | | |
| set -x | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| TAG="${{ inputs.version_tag }}" | |
| elif [[ "$GITHUB_REF" =~ ^refs/tags/ ]]; then | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| else | |
| TAG="0.0.9" | |
| fi | |
| echo "VERSION_TAG=$TAG" >> $GITHUB_ENV | |
| - name: Build the release artifacts | |
| run: | | |
| set -x | |
| unset ANDROID_SDK_ROOT | |
| cd buildscripts | |
| ./buildall.sh --arch x86 mpv | |
| ./buildall.sh --arch x86_64 mpv | |
| ./buildall.sh --arch arm64 mpv | |
| ./buildall.sh --arch armv7l mpv | |
| ./buildall.sh | |
| ./scripts/write_versions.sh arm64 | |
| cd .. | |
| ./gradlew publishReleasePublicationToMavenRepository | |
| env: | |
| GRADLE_OPTS: -Xmx4G | |
| - name: Publish to GitHub Pages | |
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./app/build/repo | |
| keep_files: true |