Build and publish app release #59
Workflow file for this run
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
name: Build and publish app release | |
on: | |
release: | |
types: [published] | |
env: | |
APP_NAME: workflow_ocr | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.APP_NAME }} | |
- name: Read package.json node and npm engines version | |
uses: skjnldsv/[email protected] | |
id: versions | |
continue-on-error: false | |
with: | |
path: ${{ env.APP_NAME }} | |
- name: Set up node ${{ steps.versions.outputs.nodeVersion }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ steps.versions.outputs.nodeVersion }} | |
- name: Set up npm ${{ steps.versions.outputs.npmVersion }} | |
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" | |
- name: Run build | |
run: cd ${{ env.APP_NAME }} && make appstore | |
- name: Upload app tarball to release | |
uses: svenstaro/upload-release-action@v2 | |
id: attach_to_release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}.tar.gz | |
asset_name: ${{ env.APP_NAME }}.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: Upload app to Nextcloud appstore | |
uses: R0Wi/nextcloud-appstore-push-action@v1 | |
with: | |
app_name: ${{ env.APP_NAME }} | |
appstore_token: ${{ secrets.APPSTORE_TOKEN }} | |
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} | |
app_private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
nightly: ${{ github.event.release.prerelease }} |