Skip to content

Commit

Permalink
[WIP] split workflow into incremental and release publish
Browse files Browse the repository at this point in the history
  • Loading branch information
h1dden-da3m0n committed Mar 29, 2021
1 parent 62477dc commit f4ad253
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions .github/workflows/app-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ on:
- master

jobs:
publish:
build-publish:
runs-on: ubuntu-20.04
environment: release
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.repository == 'jellyfin/jellyfin-android' }}
steps:
- name: Checkout repository
Expand Down Expand Up @@ -39,15 +38,41 @@ jobs:
run: ./gradlew --no-daemon --build-cache assembleRelease versionTxt

- name: Split APK release types
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
mkdir app/build/outputs/apk/libre_release app/build/outputs/apk/proprietary_release;
mv app/build/outputs/apk/**/jellyfin-android-*-libre-release.apk app/build/outputs/apk/libre_release/;
mv app/build/outputs/apk/**/jellyfin-android-*-proprietary-release.apk app/build/outputs/apk/proprietary_release/;
- uses: actions/upload-artifact@v2
with:
name: build-publish-artifact
retention-days: 7
if-no-files-found: error
path: |
app/build/outputs/apk/libre_release/*
app/build/outputs/apk/proprietary_release/*
app/build/version.txt
publish-incremental:
runs-on: ubuntu-20.04
needs: build-publish
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/download-artifact@v2
with:
name: build-publish-artifact

publish-release:
runs-on: ubuntu-20.04
needs: build-publish
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/download-artifact@v2
with:
name: build-publish-artifact

- name: Sign Libre Release APK
uses: r0adkll/sign-android-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: sign_libre
with:
releaseDirectory: app/build/outputs/apk/libre_release
Expand All @@ -58,7 +83,6 @@ jobs:

- name: Sign Proprietary Release APK
uses: r0adkll/sign-android-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: sign_proprietary
with:
releaseDirectory: app/build/outputs/apk/proprietary_release
Expand All @@ -69,10 +93,18 @@ jobs:

- name: Upload Release Artifacts
uses: ncipollo/release-action@v1.8.2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ steps.sign_libre.outputs.signedReleaseFile }},${{ steps.sign_proprietary.outputs.signedReleaseFile }},app/build/version.txt
tag: ${{ steps.variable.outputs.AppVersion }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to repo.jellyfin.org
run: |
rsync -rltgoDzOe ssh --delete --exclude '*' \
--include '${{ steps.sign_libre.outputs.signedReleaseFile }}' \
--include '${{ steps.sign_proprietary.outputs.signedReleaseFile }}' \
--include 'version.txt' \
app/build/ \
${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:/srv/repository/releases/client/android/versions/${JELLYFIN_VERSION};

0 comments on commit f4ad253

Please sign in to comment.