Skip to content

Commit

Permalink
Add build artifact in nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Binnette committed Nov 30, 2024
1 parent c730655 commit 45a5bc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ on:
- develop

jobs:
build:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v4.5.0
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -41,14 +40,14 @@ jobs:
sudo udevadm trigger --name-match=kvm
- name: Run connected tests
uses: ReactiveCircus/android-emulator-runner@v2.33.0
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: 26
script: |
adb logcat &
./gradlew connectedCheck --no-parallel
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.4
uses: coverallsapp/github-action@v2
with:
format: jacoco
15 changes: 11 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Setup Java JDK
uses: actions/setup-java@v4.5.0
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -35,16 +35,23 @@ jobs:

- name: Rename output APK
run: |
DATE=$(date +'%Y%m%d%H%M')
DATE=$(date +'%Y%m%d-%H%M')
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/OSMTracker-nightly-$DATE.apk
echo "ARTIFACT_DATE=$DATE" >> $GITHUB_ENV
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: nightly-${{ env.ARTIFACT_DATE }}
path: app/build/outputs/apk/debug/OSMTracker-nightly-*.apk

- name: Delete existing Nightly release
run: gh release delete nightly --cleanup-tag --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Nightly Release
uses: softprops/action-gh-release@v2.1.0
uses: softprops/action-gh-release@v2
with:
tag_name: 'nightly'
name: 'Nightly Build'
Expand Down

0 comments on commit 45a5bc8

Please sign in to comment.