Skip to content

Move to 7TV API v3 #605

Move to 7TV API v3

Move to 7TV API v3 #605

Workflow file for this run

name: build
on:
push:
tags:
- "v*"
pull_request:
paths-ignore:
- "README.md"
- "architecture.md"
- 'CHANGELOG.md'
- 'CONTRIBUTING.md'
branches-ignore:
- 'bttv/l10n_master'
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
# checkout current state of repo
- uses: actions/checkout@v3
# set env variables
- name: set variables
run: |
echo "APK_URL=https://www.dropbox.com/s/at7p13mfn08k77j/twitch-15.4.1.apk\?\dl=1" >> $GITHUB_ENV
# get keystore.kjs from secret
- name: create keystore.kjs from secret
run: echo "${{ secrets.KEYSTORE }}" | base64 -d > keystore.jks
# download apk when cache miss
- name: download base
if: steps.apk-cache.outputs.cache-hit != 'true'
run: wget ${{ env.APK_URL }} -O twitch.apk
# run the build using docker container
- name: run build
run: |
docker run --rm \
-v $(pwd)/twitch.apk:/usr/build/twitch.apk \
-v $(pwd)/bttv.manifest.json:/usr/build/bttv.manifest.json \
-v $(pwd)/dist:/usr/build/dist \
-v $(pwd)/mod:/usr/build/mod \
-v $(pwd)/patches:/usr/build/patches \
-v $(pwd)/.all-contributorsrc:/usr/build/.all-contributorsrc \
-v $(pwd)/keystore.jks:/usr/build/keystore.jks \
-e KS=/usr/build/keystore.jks \
-e KSPASS=${{ secrets.KSPASS }} \
ghcr.io/bttv-android/builder
# print checksums so anybody can confirm legitimacy of their apk
- name: print checksums
run: cp dist/twitch.apk bttv.apk && shasum *.apk
# send to other release job if needed
- uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'push' }}
with:
name: bttv-apk
path: bttv.apk
retention-days: 1
release:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get CHANGELOG
run: |
echo "RELEASE_BODY<<EOF" > /tmp/bttv &&
head -n25 CHANGELOG.md >> /tmp/bttv &&
echo "EOF" >> /tmp/bttv &&
cat /tmp/bttv >> $GITHUB_ENV
- uses: actions/download-artifact@v2
with:
name: bttv-apk
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ env.RELEASE_BODY }}
draft: true
prerelease: false
- run: echo "version_tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: upload Release Apk
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bttv.apk
asset_name: bttv-${{ env.version_tag }}.apk
asset_content_type: application/vnd.android.package-archive