Skip to content

3.2.0-alpha.110

3.2.0-alpha.110 #234

Workflow file for this run

name: Build release assets
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
# - run: rm -rf node_modules # hopefully this isn't necessary again
- run: npm ci
- name: Copy config files
run: |
cp static/config.default.js static/config.js
cp config/config-xml.dev.default.js config/config-xml.dev.js
- name: Build web bundle
id: web_bundle
run: |
npm run build:web
zip -r trellis-web.zip www/
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: '11'
# - name: Uninstall corrupt sdk build-tools
# run: |
# $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;31.0.0'
# $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;32.0.0'
# $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;33.0.0'
# $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;33.0.1'
- run: npm i -g @ionic/cli@6
- uses: human-nature-lab/setup-ionic@v1
with:
install-java: false
cordova-version: 11
# - name: Build dev APK
# run: |
# cordova platform add android
# npm run build:dev:android
# mv platforms/android/app/build/outputs/apk/debug/app-debug.apk trellis-dev.apk
- name: Fix hooks permissions
run: |
chmod +x -R hooks/*.sh
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4.2
- name: Build debug APK
# continue-on-error: true
run: |
npm run setup:cordova
sh cordova-setup.sh
npm run webpack:release:android
mv platforms/android/app/build/outputs/apk/debug/app-debug.apk trellis-debug.apk
# - name: Build proxy APK
# run: |
# cordova clean
# npm run setup:cordova:proxy
# cordova build android
# mv platforms/android/app/build/outputs/apk/debug/app-debug.apk trellis-proxy.apk
# - name: SSH Debug
# if: ${{ failure() }}
# run: curl -sL https://gist.githubusercontent.com/retyui/7115bb6acf151351a143ec8f96a7c561/raw/7099b9db76729dc5761da72aa8525f632d8875c9/debug-github-actions.sh | bash
# env:
# NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}
# USER_PASS: ${{ secrets.NGROK_USER_PASS }}
# - name: Keep alive if failure
# if: ${{ failure() }}
# run: sleep 1h # Prevent to killing instance after failure
- name: Release content
run: node ./make-release-content.js ${{ github.ref }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.RELEASE_TITLE }}
body_path: ${{ env.RELEASE_FILE }}
draft: ${{ env.IS_PRERELEASE == 'false' }}
prerelease: ${{ env.IS_PRERELEASE }}
# - name: Upload dev APK
# id: upload-dev-apk
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./trellis-dev.apk
# asset_name: trellis-dev.apk
# asset_content_type: application/octet-stream
- name: Upload web bundle
id: upload-web-bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./trellis-web.zip
asset_name: trellis-web.zip
asset_content_type: application/zip
- name: Upload debug APK
id: upload-debug-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./trellis-debug.apk
asset_name: ${{ env.RELEASE_TITLE}}.apk
asset_content_type: application/octet-stream
# - name: Upload debug proxy APK
# id: upload-debug-proxy-apk
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./trellis-proxy.apk
# asset_name: ${{ env.RELEASE_TITLE }}.proxy.apk
# asset_content_type: application/octet-stream