Add OBS phone list refresh action #2
Workflow file for this run
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: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Release tag, for example v0.1.0 | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| android: | |
| name: Build signed Android APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android build packages | |
| run: sdkmanager "platforms;android-35" "build-tools;35.0.0" "cmake;3.22.1" "ndk;27.0.12077973" | |
| - name: Decode Android signing key | |
| env: | |
| OPENSTREAM_RELEASE_KEYSTORE_BASE64: ${{ secrets.OPENSTREAM_RELEASE_KEYSTORE_BASE64 }} | |
| run: | | |
| if [ -z "$OPENSTREAM_RELEASE_KEYSTORE_BASE64" ]; then | |
| echo "::error::Missing OPENSTREAM_RELEASE_KEYSTORE_BASE64 secret. Releases must publish a signed APK." | |
| exit 1 | |
| fi | |
| printf '%s' "$OPENSTREAM_RELEASE_KEYSTORE_BASE64" | base64 --decode > android/app/openstream-release.keystore | |
| - name: Build signed release APK with native SRT enabled | |
| working-directory: android | |
| env: | |
| OPENSTREAM_RELEASE_KEYSTORE: ${{ github.workspace }}/android/app/openstream-release.keystore | |
| OPENSTREAM_RELEASE_STORE_PASSWORD: ${{ secrets.OPENSTREAM_RELEASE_STORE_PASSWORD }} | |
| OPENSTREAM_RELEASE_KEY_ALIAS: ${{ secrets.OPENSTREAM_RELEASE_KEY_ALIAS }} | |
| OPENSTREAM_RELEASE_KEY_PASSWORD: ${{ secrets.OPENSTREAM_RELEASE_KEY_PASSWORD }} | |
| OPENSTREAM_VERSION_NAME: ${{ inputs.tag || github.ref_name }} | |
| OPENSTREAM_VERSION_CODE: ${{ github.run_number }} | |
| run: | | |
| for name in OPENSTREAM_RELEASE_STORE_PASSWORD OPENSTREAM_RELEASE_KEY_ALIAS OPENSTREAM_RELEASE_KEY_PASSWORD; do | |
| if [ -z "${!name}" ]; then | |
| echo "::error::Missing ${name} secret. Releases must publish a signed APK." | |
| exit 1 | |
| fi | |
| done | |
| chmod +x ./gradlew | |
| ./gradlew --no-daemon :app:assembleRelease | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openstream-android-release-apk | |
| path: android/app/build/outputs/apk/release/app-release.apk | |
| if-no-files-found: error | |
| obs-plugin: | |
| name: Build OBS plugin | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install OBS Studio | |
| shell: powershell | |
| run: choco install obs-studio -y --no-progress | |
| - name: Build plugin package | |
| shell: cmd | |
| run: | | |
| set OPENSTREAM_SKIP_INSTALL=1 | |
| set OPENSTREAM_PLUGIN_PACKAGE_DIR=%CD%\artifacts | |
| call build_plugin.bat | |
| - name: Install Inno Setup | |
| shell: powershell | |
| run: choco install innosetup -y --no-progress | |
| - name: Build plugin installer | |
| shell: powershell | |
| env: | |
| OPENSTREAM_VERSION: ${{ inputs.tag || github.ref_name }} | |
| run: | | |
| if (-not $env:OPENSTREAM_VERSION) { | |
| $env:OPENSTREAM_VERSION = "manual" | |
| } | |
| $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| & $iscc "tools\installer\openstream-obs-plugin.iss" ` | |
| "/DPluginDll=$PWD\obs-plugin\build\openstream-obs.dll" ` | |
| "/DOutputDir=$PWD\artifacts" ` | |
| "/DOutputBaseFilename=openstream-obs-plugin-installer-windows-x64" ` | |
| "/DOpenStreamVersion=$env:OPENSTREAM_VERSION" | |
| - name: Upload plugin artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openstream-obs-windows-x64 | |
| path: | | |
| artifacts/openstream-obs-windows-x64.zip | |
| artifacts/openstream-obs-plugin-installer-windows-x64.exe | |
| if-no-files-found: error | |
| publish: | |
| name: Publish GitHub release | |
| runs-on: ubuntu-latest | |
| needs: [android, obs-plugin] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Normalize artifact names | |
| run: | | |
| cp dist/app-release.apk dist/openstream-android.apk | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| INPUT_TAG: ${{ inputs.tag }} | |
| run: | | |
| TAG_NAME="${INPUT_TAG:-${GITHUB_REF_NAME}}" | |
| gh release create "$TAG_NAME" \ | |
| dist/openstream-android.apk \ | |
| dist/openstream-obs-plugin-installer-windows-x64.exe \ | |
| dist/openstream-obs-windows-x64.zip \ | |
| --target "$GITHUB_SHA" \ | |
| --title "OpenStream ${TAG_NAME}" \ | |
| --notes-file docs/release-notes-template.md | |