-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.19.0 metadata fixes + auto release via Github actions
- Loading branch information
Showing
5 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ on: | |
branches: | ||
- master | ||
- stable* | ||
release: | ||
types: [published] | ||
|
||
env: | ||
APP_NAME: workflow_ocr | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build and publish app release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
APP_NAME: workflow_ocr | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.APP_NAME }} | ||
- 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 | ||
# TODO: maybe path appinfo.xml with current version | ||
- name: Upload app to Nextcloud appstore | ||
env: | ||
APP_NAME: ${{ env.APP_NAME }} | ||
APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }} | ||
NIGHTLY: ${{ github.event.release.prerelease }} | ||
DOWNLOAD_URL: ${{ steps.attach_to_release.outputs.browser_download_url }} | ||
ENCRYPTED_PK_PATH: ${{ github.workspace }}/${{ env.APP_NAME }}/.github/workflows/secrets/${{ env.APP_NAME }}.key.enc | ||
PK_DECRYPT_PW: ${{ secrets.APP_PK_ENCRYPTION_KEY }} | ||
run: | | ||
cd ${{ env.APP_NAME }}/.github/workflows/scripts | ||
chmod +x push_appstore.sh | ||
./push_appstore.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Used env-variables: | ||
# APP_NAME | ||
# APPSTORE_TOKEN | ||
# NIGHTLY | ||
# DOWNLOAD_URL | ||
# ENCRYPTED_PK_PATH | ||
# PK_DECRYPT_PW | ||
|
||
echo "Downloading app tarball for signing" | ||
wget "$DOWNLOAD_URL" -O "${APP_NAME}.tar.gz" | ||
|
||
echo "Decrypt signing key" | ||
openssl aes-256-cbc -in $ENCRYPTED_PK_PATH -out ${APP_NAME}.key -pass pass:${PK_DECRYPT_PW} -d -iter 1000 -salt | ||
|
||
echo "Creating signature for app release" | ||
sign="`openssl dgst -sha512 -sign ${APP_NAME}.key ${APP_NAME}.tar.gz | openssl base64 -A`" | ||
|
||
echo "Creating new app release in Nextcloud appstore (nightly=${NIGHTLY})" | ||
curl -X POST https://apps.nextcloud.com/api/v1/apps/releases -H "Authorization: Token ${APPSTORE_TOKEN}" -H "Content-Type: application/json" -d "{\"download\":\"${DOWNLOAD_URL}\", \"signature\": \"${sign}\", \"nightly\": ${NIGHTLY} }" |
Binary file not shown.
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