-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from damontecres/fea/debug-builds
Add develop build workflow
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Development build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
APK_SHORT_NAME: StashAppAndroidTV-debug.apk | ||
TAG_NAME: develop | ||
|
||
jobs: | ||
advance-tag: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Advance ${{ env.TAG_NAME }} tag | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
try { | ||
await github.git.deleteRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "tags/${{ env.TAG_NAME }}" | ||
}) | ||
} catch (e) { | ||
console.log("The ${{ env.TAG_NAME }} tag doesn't exist yet: " + e) | ||
} | ||
await github.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ env.TAG_NAME }}", | ||
sha: context.sha | ||
}) | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Need the tags to build | ||
submodules: true # Need the submodules to build | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: '17' | ||
cache: 'gradle' | ||
- name: Build app | ||
id: buildapp | ||
run: | | ||
./gradlew clean assembleDebug | ||
echo "apk=$(ls app/build/outputs/apk/debug/StashAppAndroidTV-debug*.apk)" >> "$GITHUB_OUTPUT" | ||
- name: Copy APK to ${{ env.APK_SHORT_NAME }} | ||
run: | | ||
cp ${{ steps.buildapp.outputs.apk }} ${{ env.APK_SHORT_NAME }} | ||
- name: Create GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifactErrorsFailBuild: true | ||
artifacts: "${{ steps.buildapp.outputs.apk }},${{ env.APK_SHORT_NAME }}" | ||
generateReleaseNotes: false | ||
makeLatest: false | ||
name: "Develop build" | ||
prerelease: true | ||
removeArtifacts: true | ||
replacesArtifacts: true | ||
tag: "${{ env.TAG_NAME }}" | ||
updateOnlyUnreleased: true | ||
|
||
body: | | ||
This pre-release tracks the latest development debug build of StashAppAndroidTV from the `main` branch | ||
See https://github.com/damontecres/StashAppAndroidTV/releases/latest for the latest stable release |