build(app): prepare for new 2.1.0 pre-release #113
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: Pre-release CI | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
contents: write | |
concurrency: | |
group: "pre-release" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: "archives" | |
path: "archives" | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup Android SDK | |
run: | | |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3" | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Build release artifacts | |
uses: gradle/gradle-command-action@v2 | |
with: | |
arguments: assembleRelease bundleReleaseClassesToCompileJar | |
- name: Generate provider stubs | |
run: | | |
chmod +x .github/create_provider_stubs.sh | |
.github/create_provider_stubs.sh | |
- name: Sign release APK | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Clean up build artifacts | |
run: | | |
set -e | |
mv app/build/outputs/apk/release/app-release-unsigned-signed.apk flixclusive-release.apk | |
sha=`sha256sum flixclusive-release.apk | awk '{ print $1 }'` | |
echo "RELEASE_SHA=$sha" >> $GITHUB_ENV | |
- name: Get soon-latest version | |
run: | | |
chmod +x .github/parse_version.sh | |
version=$(.github/parse_version.sh) | |
echo "Version: $version" | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Generate changelogs | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fromTag: ${{ github.ref_name }} | |
toTag: pre-release | |
excludeTypes: '' | |
writeToFile: false | |
- name: Delete old pre-release | |
uses: cb80/delrel@latest | |
with: | |
tag: pre-release | |
- name: Update old pre-release tag | |
uses: EndBug/latest-tag@latest | |
with: | |
ref: pre-release | |
- name: Upload new pre-release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: pre-release | |
name: Pre-release for v${{ env.VERSION }} | |
body: | | |
##### _NOTE: Android TV is incomplete, the providers on this port are not yet installable. Though, you could test it now._ | |
--- | |
### 🐞 Known issues | |
- TV focus crashes. Compose TV is bugged af; we wait til the new update. | |
${{ steps.changelog.outputs.changes }} | |
--- | |
### Checksums | |
| Variant | SHA-256 | | |
| ------- | ------- | | |
| release | ${{ env.RELEASE_SHA }} | | |
files: | | |
flixclusive-release.apk | |
build/stubs/provider-stubs.aar | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get short SHA | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Get current date and time for archive purposes | |
run: | | |
echo "ARCHIVE_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | |
- name: Backup pre-release on archives branch | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/archives/${{ env.VERSION }} | |
cp flixclusive-release.apk "$GITHUB_WORKSPACE/archives/${{ env.VERSION }}/PR-${{ env.SHORT_SHA }} ${{ env.ARCHIVE_DATE }}.apk" | |
- name: Push pre-release apk to archives branch | |
run: | | |
cd $GITHUB_WORKSPACE/archives | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add "$GITHUB_WORKSPACE/archives/${{ env.VERSION }}/PR-${{ env.SHORT_SHA }} ${{ env.ARCHIVE_DATE }}.apk" | |
git commit -m "Archive PR-${{ env.SHORT_SHA }} $(date +"%Y-%m-%d")" || exit 0 | |
git push |