Skip to content

Update lock file 🔒 #497

Update lock file 🔒

Update lock file 🔒 #497

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build Android
on:
push:
branches: [ development ]
jobs:
build:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "yarn"
- name: 🧶 Yarn install
run: yarn ci
- name: Set environment icon & splash for android app
run: |
# to make it easier to tell which is which when multiple are installed
node ./_scripts/_setAppSplashTheme.mjs --nightly
- name: 🔍Lint code
run: yarn lint
continue-on-error: true
- name: 📚Read package.json
id: pkg
uses: jaywcjlove/[email protected]
- name: Set Version Number Variable
id: versionNumber
uses: actions/github-script@v6
with:
result-encoding: string
script: |
return '${{ steps.pkg.outputs.version }}-nightly-${{ github.run_number }}'
- name: Set App ID Variable
id: appId
uses: actions/github-script@v6
with:
result-encoding: string
script: |
return '${{ steps.pkg.outputs.name }}.nightly'
- name: ⬆ Update package.json version
uses: jossef/[email protected]
with:
file: package.json
field: version
value: ${{ steps.versionNumber.outputs.result }}
- name: ⬆ Update package.json app environment
uses: jossef/[email protected]
with:
file: package.json
field: name
value: ${{ steps.appId.outputs.result }}
- name: ⬆ Update package.json product name
uses: jossef/[email protected]
with:
file: package.json
field: productName
value: ${{ steps.pkg.outputs.productName }} Nightly
- name: 📦 Pack for 🕸web with Node.js
run: yarn pack:web
- name: 🐋 Build docker image
run: |
docker build -t ghcr.io/marmadilemanteater/freetubecordova-nightly:${{ steps.versionNumber.outputs.result }} .
docker build -t ghcr.io/marmadilemanteater/freetubecordova-nightly:latest .
- name: 🗝 Login to Github Container Registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u MarmadileManteater --password-stdin
- name: 📡 Push docker image to Github Container Registry
run: |
docker push ghcr.io/marmadilemanteater/freetubecordova-nightly:${{ steps.versionNumber.outputs.result }}
docker push ghcr.io/marmadilemanteater/freetubecordova-nightly:latest
- name: 📡 Upload PWA Artifact
uses: actions/upload-artifact@v3
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-PWA
path: dist/web
- name: 📦 Pack for 📱Android
run: yarn pack:android:dev
- name: 🦴 Fetch keystore from secrets
run: |
while read -r line;
do
echo "${line}" >> freetube.keystore.asc
done <<< '${{ secrets.KEYSTORE }}'
gpg -d --passphrase '${{ secrets.KEYSTORE_PASSWORD }}' --batch freetube.keystore.asc >> freetube.keystore
- name: Inject signing config from secrets
run: |
sed -i 's@// inject signing config@// inject signing config\r\nstorePassword = "${{ secrets.KEYSTORE_PASSWORD }}"@' android/app/build.gradle.kts
sed -i 's@// inject signing config@// inject signing config\r\nstoreFile = file("../../freetube.keystore")@' android/app/build.gradle.kts
sed -i 's@// inject signing config@// inject signing config\r\nkeyPassword = "${{ secrets.KEYSTORE_PASSWORD }}"@' android/app/build.gradle.kts
sed -i 's@// inject signing config@keyAlias = "freetubecordova"@' android/app/build.gradle.kts
cat android/app/build.gradle.kts
- name: Update name
run: |
sed -i 's/"FreeTube Android"/"FreeTube Nightly"/g' android/settings.gradle.kts
sed -i 's/FreeTube Android/FreeTube Nightly/g' android/app/src/main/res/values/strings.xml
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: cd android/ && chmod +x gradlew
- name: Build with Gradle
run: cd android/ && ./gradlew build
- name: Rename APK w/ version info
run: |
cp android/app/build/outputs/apk/debug/app-debug.apk dist/freetube-${{ steps.versionNumber.outputs.result }}-Android.apk
- name: 📡 Upload APK Artifact
uses: actions/upload-artifact@v3
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-Android.apk
path: dist/freetube-${{ steps.versionNumber.outputs.result }}-Android.apk